From: skaller <skaller@users.sourceforge.net>
To: Nicolas Cannasse <warplayer@free.fr>
Cc: Alain Frisch <Alain.Frisch@inria.fr>, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Obj.dup crash ?
Date: 31 Dec 2004 08:48:03 +1100 [thread overview]
Message-ID: <1104443282.29293.11.camel@pelican.wigram> (raw)
In-Reply-To: <002f01c4ee5f$49820ca0$0100a8c0@warp>
On Thu, 2004-12-30 at 22:04, Nicolas Cannasse wrote:
> > Concerning Obj.dup, I guess it is never actually called when the block
> > has 0 fields. Actually, where is Obj.dup used except in
> > CamlinternalOO.copy ? Quick look. It is used in the code generator:
> > for array constants of size > 4, and for record expressions { ... with
> > ... } that copy the original record and then modify it (but the empty
> > record is not a valid type !). So indeed, it seems that Obj.dup is never
> > called for 0 fields blocks. The implementation has dead code, but
> > it is not buggy ;-)
>
> It's also used in ExtLib DynArray when copying an array ;)
Obj.dup (Obj.magic (Array.make 0 0)); Gc.major();;
Warning S: this expression should have type unit.
Segmentation fault
What's the representation of a 0 length Array?
The weird message is due to CVS ocaml 3.09+dev12.
Array.copy doesn't exhibit this fault.
--
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850,
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net
prev parent reply other threads:[~2004-12-30 21:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-29 13:38 Nicolas Cannasse
2004-12-29 15:49 ` [Caml-list] " Alain Frisch
2004-12-29 16:49 ` Nicolas Cannasse
[not found] ` <41D358E2.4000604@inria.fr>
2004-12-30 11:04 ` Nicolas Cannasse
2004-12-30 21:48 ` skaller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1104443282.29293.11.camel@pelican.wigram \
--to=skaller@users.sourceforge.net \
--cc=Alain.Frisch@inria.fr \
--cc=caml-list@inria.fr \
--cc=warplayer@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox