diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2003-10-16 23:22:23 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2003-10-16 23:22:23 +0000 |
commit | e969e8ad9fdce5a8a33946587d45b3e4c22cae90 (patch) | |
tree | 7d7d2282c138d420cb03a5c2c4ba87554bcd6736 /byterun/extern.c | |
parent | 5320c8fce63acb42f92483a0462e917c32fdf2b6 (diff) |
PR#1878
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5873 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/extern.c')
-rw-r--r-- | byterun/extern.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/byterun/extern.c b/byterun/extern.c index 4d5888002..7e29d0ccd 100644 --- a/byterun/extern.c +++ b/byterun/extern.c @@ -246,8 +246,15 @@ static void extern_rec(value v) asize_t h; if (tag == Forward_tag) { - v = Forward_val (v); - goto tailcall; + value f = Forward_val (v); + if (Is_block (f) && (Is_young (f) || Is_in_heap (f)) + && (Tag_val (f) == Forward_tag || Tag_val (f) == Lazy_tag + || Tag_val (f) == Double_tag)){ + /* Do not short-circuit the pointer. */ + }else{ + v = f; + goto tailcall; + } } /* Atoms are treated specially for two reasons: they are not allocated in the externed block, and they are automatically shared. */ @@ -347,9 +354,6 @@ static void extern_rec(value v) size_64 += 2 + ((sz_64 + 7) >> 3); break; } - case Forward_tag: - Assert(0); - /*fallthrough*/ default: { mlsize_t i; if (tag < 16 && sz < 8) { |