You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead, it segfaults on Windows and Linux, and passes (erroneously) on MacOS.
If foo is declared as a var, or if reassign takes a []u8, the test passes (erroneously) instead of segfaulting. Presumably this is because the string is no longer being stored in read-only memory. If the reassignment is changed to s = s, the compiler correctly emits an error. So my guess is that the slice expression is tripping up the "assign to constant" check.
The text was updated successfully, but these errors were encountered:
daurnimator
added
bug
Observed behavior contradicts documented or intended behavior
stage1
The process of building from source via WebAssembly and the C backend.
labels
Dec 31, 2019
The following test should result in a compile-time error, "cannot assign to constant":
Instead, it segfaults on Windows and Linux, and passes (erroneously) on MacOS.
If
foo
is declared as avar
, or ifreassign
takes a[]u8
, the test passes (erroneously) instead of segfaulting. Presumably this is because the string is no longer being stored in read-only memory. If the reassignment is changed tos = s
, the compiler correctly emits an error. So my guess is that the slice expression is tripping up the "assign to constant" check.The text was updated successfully, but these errors were encountered: