Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Out-of-bounds error when printing out a function value


FWIW
I tried to add the & operator beside the _start:
   std.put("_start = {x}\n", &_start)

It no longer shows out-of-bounds error but the printed value is still
confusing.

An equivalent C program prints exactly the value of the symbol shown by nm.
Not sure if there is a difference between C and Myrddin regarding this
example or I made some mistakes.
Hopefully, it's not too stupid.

On 5 December 2017 at 14:36, nml <arumakanil@xxxxxxxxx> wrote:

> The following program:
>
>    use std
>    const main = {
>            extern const _start : (->void)
>            std.put("_start = {x}\n", _start)
>    }
>
> Output:
>    Building
>     6m -I /lib/myr in.myr     ld -o a.out /lib/myr/_myrrt.o in.o -lstd
> -L/lib/myr -lsys    0x000000000041150d: out of bounds access Internal
> error: /a.out: exited with signal 31
>
> Looks like a bug. I expected that the value shown by nm is printed.
>
> --
> mura
>
>
>

Follow-Ups:
Re: Out-of-bounds error when printing out a function valueOri Bernstein <ori@xxxxxxxxxxxxxx>
References:
Out-of-bounds error when printing out a function valuenml <arumakanil@xxxxxxxxx>