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

Crash in instance_eval and instance_exec #3432

Closed
clayton-shopify opened this Issue Feb 6, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@clayton-shopify
Contributor

clayton-shopify commented Feb 6, 2017

The following input demonstrates a crash:

instance_eval { super &0 }

This issue was reported by https://hackerone.com/d4nny

I noticed that the following also crashes:

instance_exec { super &0 }

And the following don't behave as expected. In MRI they result in "super called outside of method" but in MRuby the results are different:

$ bin/mirb
mirb - Embeddable Interactive Ruby Shell

> instance_eval { super 0 }
(mirb):1: expected String (TypeError)
> instance_exec { super 0 }
(mirb):2: no block given (ArgumentError)
@matz

This comment has been minimized.

Show comment
Hide comment
@matz

matz Feb 8, 2017

Member

Will be fixed. instance_eval can take a string argument where instance_exec cannot. That's the reason they raise different exceptions.

Member

matz commented Feb 8, 2017

Will be fixed. instance_eval can take a string argument where instance_exec cannot. That's the reason they raise different exceptions.

@matz matz closed this in af4d74f Feb 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment