[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-dev
Subject:    Re: [LLVMdev] Tag number of OCaml Variant in executionengine
From:       Erick Tryzelaar <idadesub () users ! sourceforge ! net>
Date:       2010-02-28 23:48:52
Message-ID: 1ef034531002281548h7367c81bv4ac0ba095d586bbb () mail ! gmail ! com
[Download RAW message or body]

On Sun, Feb 28, 2010 at 8:38 AM, Jianzhou Zhao <jianzhou@seas.upenn.edu> wrote:
> Hi,
>
> At the code below from
> ./bindings/ocaml/executionengine/executionengine_ocaml.c,
> we create an OCaml Variant from C. It is from 2.6, the latest 2.7 has
> the same code.
>
> Line 240 Option = alloc(1, 1) assigns tag1 to the 'some' constructor.
> In term of http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html,
> I think the 'some' should have a tag 0. We dont have a runtime error
> for this, the reason might be there is only two constructors, one
> is None represented as unboxed int, the other is Some represented
> as a tagged block, and OCaml runtime may only distinguish them
> as the structures, but not the tag number.

Sounds reasonable. I'll make the change to make things more
consistent. Also, I see that we aren't properly protecting our option
values against the GC in a couple places. I'll make those changes too.

-e
_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic