Ticket #902 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

segfault with macro

Reported by: coke Owned by: chromatic
Priority: normal Milestone: 2.1
Component: imcc Version: trunk
Severity: fatal Keywords:
Cc: Language:
Patch status: Platform:

Description

Arguably, this could either print out 0 and stop, or it could complain about a bad label.

Currently, it segfaults.

(While macro taken verbatim from hllmacros.pir)

$ more foo.pir
.macro While(conditional, code)
.label $beginwhile:
    unless .conditional goto .$endwhile
    .code
  goto .$beginwhile
.label $endwhile:
.endm

.sub main
.While($I0 < 3, {
say $I0
goto .$endwhile
inc $I0
})
.end

Change History

Changed 5 years ago by coke

  • milestone set to 1.9

Still occurring in r42564.

Changed 5 years ago by whiteknight

  • owner set to whiteknight

Changed 5 years ago by coke

  • milestone changed from 1.9 to 2.0

Changed 5 years ago by chromatic

  • owner changed from whiteknight to chromatic
  • milestone changed from 2.0 to 2.1

The segfault is in IMCC due to a missing label name; confirmed with 2.0.0. I can poke at this.

Changed 5 years ago by chromatic

  • status changed from new to closed
  • resolution set to fixed

Fixed in r43532 and test added to t/compilers/imcc/syn/macro.t. Thanks!

Note: See TracTickets for help on using tickets.