Skip to content

Unreachable code path in Fiddle::ValueUtil#wrap_arg #124

Description

@Maumagnaguagno

In Fiddle::ValueUtil#wrap_arg there is a long case-when for arg with an unreachable code path.
When arg and ty are of Array type, and ty[0] is TYPE_CHAR, there is another condition, for arg to be String at Line 101.
Even if this condition is fixed, val is undefined at Line 102 for this method.

whenArray
if(ty.is_a?(Array))# used only by struct
casety[0]
whenTYPE_VOIDP
returnarg.collect{|v| Integer(v)}
whenTYPE_CHAR
if(arg.is_a?(String))
returnval.unpack('C*')
end
end
end
returnarg

Should Lines 100-103 be removed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions