oridb/mc

union in tuple printed incorrectly.

andrewchambers opened this issue · 2 comments

use std

type sclass = union
    `Sclassnone
;;

type ctype = union
    `Tyaggr caggr#
    `Tyvoid
;;

type caggr = union
    `Typtr ctype
;;

const main = {
    std.put("{}\n", (`Sclassnone, `Tyvoid))
}
ac@black:~/src/qc$ mbld -R ~/Desktop/bug/bug.myr 
/tmp/runmyr4013777324...
    6m  /home/ac/Desktop/bug/bug.myr 
    ld  -o /tmp/runmyr4013777324 /usr/local/lib/myr/_myrrt.o /home/ac/Desktop/bug/bug.o -L/usr/local/lib/myr -lstd -lsys 
    /tmp/runmyr4013777324   
(`Sclassnone , `Tyaggr 0x00007ffc00000001)
oridb commented

This seems to be an alignment issue when walking the type information, although I'm a bit confused why adding an integer in the middle of the tuple fixes it. Putting prints into the vararg address calculations doesn't seem to change the address.

oridb commented

Huh. I wonder if we just need to align the start of a va_list...