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
The C interface to ocaml offers the caml_get_public_method function
for retrieving a closure by hash from an object's method table.
Unfortunately, this function always returns some method, even if the
table doesn't contain the requested method! It seems
caml_get_public_method doesn't check that the hash you supplied
matches the hash it found. It would be nice if either: a)
caml_get_public_method verified that it found the correct method and
returned NULL if it didn't, or b) you provided a separate function
caml_get_valid_public_method that does so.
This does not seem a bad idea, since the tags are in the table.
There is however a pitfall: due to the hashing approach used, tags are
not guaranteed to be unique. That is, even if the found tag were to be
checked, this is not a guarantee that the right method has been found.
But the probability is sufficiently low that at least it would help for
debugging.
Anyway, thanks for your suggestion, which will be considered.
Jacques
The text was updated successfully, but these errors were encountered:
Original bug ID: 3761
Reporter: administrator
Status: closed (set by @garrigue on 2008-01-25T08:37:56Z)
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Child of: #3760
Monitored by: n8gray
Bug description
From: n8gray@caltech.edu
This does not seem a bad idea, since the tags are in the table.
There is however a pitfall: due to the hashing approach used, tags are
not guaranteed to be unique. That is, even if the found tag were to be
checked, this is not a guarantee that the right method has been found.
But the probability is sufficiently low that at least it would help for
debugging.
Anyway, thanks for your suggestion, which will be considered.
Jacques
The text was updated successfully, but these errors were encountered: