-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unreachable code path in Fiddle::ValueUtil#wrap_arg #124
Comments
Can you create a script that uses 101 and share it to us? |
require 'fiddle/value'
c = Class.new.extend(Fiddle::ValueUtil)
p c.wrap_arg(['55','0'],[Fiddle::TYPE_VOIDP]) # Line 99
p c.wrap_arg(['test'],[Fiddle::TYPE_CHAR]) # Line 106 |
Ah, could you use normal API instead of directly using |
Unfortunately I am not that familiar with Fiddle structs to make a valid minimal example to reach that point. |
OK. |
In Fiddle::ValueUtil#wrap_arg there is a long case-when for
arg
with an unreachable code path.When
arg
andty
are of Array type, andty[0]
is TYPE_CHAR, there is another condition, forarg
to be String at Line 101.Even if this condition is fixed,
val
is undefined at Line 102 for this method.fiddle/lib/fiddle/value.rb
Lines 95 to 106 in 04238ce
Should Lines 100-103 be removed?
The text was updated successfully, but these errors were encountered: