-
-
Notifications
You must be signed in to change notification settings - Fork 669
Field access doesn't check for null #507
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
Comments
This can result in somewhat hard to check errors. I understand this can be performance trade-off, but at least should fail when optimizations are disabled. |
What will happen here is that if Of course, by typing it Any ideas or experience how other languages do this? |
I see two options viable for AssemblyScript:
|
Hmm, I tried replicate this with C++/Clang and see how this handle here but Clang generated 0.5 Mb binary size with |
@dcodeIO what about define |
Oh, yeah, a |
It emit runtime error for now: @vgrichina could you check plz maybe we could close this? |
@dcodeIO could we close this, wdyt? |
Closing this issue as part of 2020 vacuum because it seems to have been solved meanwhile. In particular, a runtime check is now being performed if the array is potentially "holey", and a convention is established that any such array must be filled before use to avoid the error. |
I assume it's probably because
null
is 0 in AssemblyScript andthis.data[i].rgb
points to some perfectly valid address even whenthis.data[i]
isnull
.The text was updated successfully, but these errors were encountered: