-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
Description
Jane street is using a segfault function for debugging.
It is doing Obj.set_field (Obj.repr 0) 0 (Obj.repr string_that_should_be_easy_to_detect)
With flambda, this is detected as a misuse of set_field
because the literal 0 is (rightly) not considered to be a valid mutable block. set_field
seems to be one of the most common misuse unsafe function and its behavior might change in some undefined cases. This check is done to catch early some of those problems.
The best way is probably to add a "trap" primitive that is lowered to dereferencing 0 in cmm.