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
"A function that has parameters or local variables of type value must begin with a call to one of the CAMLparam macros and return with CAMLreturn, CAMLreturn0, or CAMLreturnT."
"Local variables of type value must be declared with one of the CAMLlocal macros. Arrays of values are declared with CAMLlocalN. These macros must be used at the beginning of the function, not in a nested block."
...
Is this an oversight or is there some very good reason to not follow the rules?
It might actually be fine because caml_copy_double is the only allocating operation in them. Accesses to all value-typed arguments happen before that, so GC won't move/delete anything we want to still access.
Our
FloatOps
C stubs are implemented likeanalyzer/src/common/cdomains/floatOps/stubs.c
Lines 39 to 48 in f2f5cc1
These violate GC rules set out by OCaml documentation for C stubs (https://v2.ocaml.org/manual/intfc.html#s%3Ac-gc-harmony):
value
must begin with a call to one of theCAMLparam
macros and return withCAMLreturn
,CAMLreturn0
, orCAMLreturnT
."value
must be declared with one of theCAMLlocal
macros. Arrays of values are declared withCAMLlocalN
. These macros must be used at the beginning of the function, not in a nested block."Is this an oversight or is there some very good reason to not follow the rules?
Not doing so can lead to some very unusual GC bugs: xavierleroy/pringo#6.
The text was updated successfully, but these errors were encountered: