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

Don't crash string- and num-ifying Numbers (#55) #56

Closed
wants to merge 1 commit into from

Conversation

catb0t
Copy link
Contributor

@catb0t catb0t commented Nov 6, 2018

Going to change the return values and add tests as well, so don't merge yet.

closes #55

@catb0t
Copy link
Contributor Author

catb0t commented Nov 6, 2018

The number of places where this computed goto is used in Number is large, I think adding checking code is actually the wrong fix, because such checks are absent from lots of code that doesn't crash

I guess the right fix would be like changing how pointers-to null/nil are handled more fundamentally(?), but I don't know how to do that

@catb0t
Copy link
Contributor Author

catb0t commented Nov 6, 2018

hm, 46 more subs that need this check code added? I really think this is wrong, but I'll write the right fix if you tell me what that is :)

@trizen
Copy link
Owner

trizen commented Nov 6, 2018

No need to handle this. This would require changing the entire Number class. Since Number objects are immutable by default, the self value is always expected to be a Number object.

@trizen trizen closed this Nov 6, 2018
@catb0t catb0t deleted the fix-nil-num branch November 6, 2018 19:56
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

Successfully merging this pull request may close these issues.

Dereferenced assignment of Number variable crashes REPL
2 participants