Skip to content
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
Closed

Crash in instance_eval and instance_exec #3432

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

Comments

@clayton-shopify
Copy link
Contributor

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
Copy link
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 as completed in af4d74f Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants