diff options
Diffstat (limited to 'byterun/obj.c')
-rw-r--r-- | byterun/obj.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/byterun/obj.c b/byterun/obj.c index 3ee12201e..6332e4de9 100644 --- a/byterun/obj.c +++ b/byterun/obj.c @@ -189,7 +189,7 @@ CAMLprim value caml_lazy_make_forward (value v) CAMLreturn (res); } -/* For camlinternalOO.ml +/* For mlvalues.h and camlinternalOO.ml See also GETPUBMET in interp.c */ @@ -202,7 +202,8 @@ CAMLprim value caml_get_public_method (value obj, value tag) if (tag < Field(meths,mi)) hi = mi-2; else li = mi; } - return Field (meths, li-1); + /* return 0 if tag is not there */ + return (tag == Field(meths,li) ? Field (meths, li-1) : 0); } /* these two functions might be useful to an hypothetical JIT */ |