-
Notifications
You must be signed in to change notification settings - Fork 5
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
SIGABRT when reading nonexistent array members #30
Comments
FGasper
added a commit
to FGasper/JavaScript-Duktape-XS
that referenced
this issue
Nov 17, 2021
Issue gonzus#30: JS “undefined” causes Duktape’s duk_get_prop_index() to return false, even though the value *does* exist. (This is an apparent bug either in Duktape or its documentation, which suggests that any existent property should cause a truthy return from that function.) In that case pl_duk_to_perl_impl() was neglecting to duk_pop(ctx), which caused the next read on the array to be an attempt to read index 1 from undefined, which triggered an abort(). This fixes that by ensuring that we always duk_pop(ctx) in the relevant piece of code.
FGasper
added a commit
to FGasper/JavaScript-Duktape-XS
that referenced
this issue
Nov 17, 2021
Issue gonzus#30: JS “undefined” causes Duktape’s duk_get_prop_index() to return false, even though the value *does* exist. (This is an apparent bug either in Duktape or its documentation, which suggests that any existent property should cause a truthy return from that function.) In that case pl_duk_to_perl_impl() was neglecting to duk_pop(ctx), which caused the next read on the array to be an attempt to read index 1 from undefined, which triggered an abort(). This fixes that by ensuring that we always duk_pop(ctx) in the relevant piece of code.
FGasper
added a commit
to FGasper/JavaScript-Duktape-XS
that referenced
this issue
Nov 17, 2021
Issue gonzus#30: JS “undefined” causes Duktape’s duk_get_prop_index() to return false, even though the value *does* exist. (This is an apparent bug either in Duktape or its documentation, which suggests that any existent property should cause a truthy return from that function.) In that case pl_duk_to_perl_impl() was neglecting to duk_pop(ctx), which caused the next read on the array to be an attempt to read index 1 from undefined, which triggered an abort(). This fixes that by ensuring that we always duk_pop(ctx) in the relevant piece of code.
FGasper
changed the title
SIGABRT on try/catch
SIGABRT when reading nonexistent array members
Nov 17, 2021
FGasper
added a commit
to FGasper/JavaScript-Duktape-XS
that referenced
this issue
Dec 3, 2021
Issue gonzus#30: Missing JS array items cause Duktape’s duk_get_prop_index() to return false. In that case pl_duk_to_perl_impl() was neglecting to duk_pop(ctx), which caused the next read on the array to be an attempt to read index 1 from undefined, which triggered an abort(). This fixes that by ensuring that we always duk_pop(ctx) in the relevant piece of code and return Perl undef to represent missing array items.
FGasper
added a commit
to FGasper/JavaScript-Duktape-XS
that referenced
this issue
Dec 3, 2021
Issue gonzus#30: Missing JS array items cause Duktape’s duk_get_prop_index() to return false. In that case pl_duk_to_perl_impl() was neglecting to duk_pop(ctx), which caused the next read on the array to be an attempt to read index 1 from undefined, which triggered an abort(). This fixes that by ensuring that we always duk_pop(ctx) in the relevant piece of code and return Perl undef to represent missing array items.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
… yields SIGABRT, with the following output:
The text was updated successfully, but these errors were encountered: