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

Compiler: fixed is_a? transform may cause an exception #4390


Copy link

Fixed #4364


This code may trigger an exception about enclosing call.
This will be transformed to below:

Const === Something.some_method

The compiler checks enclosing call of Something.some_method twice, and causes an exception.
So, cloning the ASTNode could solve this bug.

fixed crystal-lang#4364

`(Something.some_method).is_a?(Const)` will transform to
`Const === Something.some_method`

It should clone the `node.const` and `node.obj` to do this work.
Copy link
Contributor Author

Is there anyone who could restart this build?

Travis CI error log

==> Installing llvm 
==> Downloading
Error: Failed to download resource "llvm"

Copy link

refi64 commented May 8, 2017

Just close and re-open the PR. It'll automatically restart the build.

Copy link
Contributor Author

@kirbyfan64 Thanks!
But someone has restarted this build, and it build passed.

Copy link

Thanks! Looks good to me, I'm just running a couple of quick benchmarks and unless I find something odd there I'll merge it soon.

@mverzilli mverzilli merged commit 78e2d21 into crystal-lang:master May 8, 2017
@mverzilli mverzilli added this to the Next milestone May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants