#484: illegal instruction/segfault with Timer PMC
--------------------+-------------------------------------------------------
Reporter: coke | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: none | Version:
Severity: medium | Keywords:
Lang: | Patch:
Platform: |
--------------------+-------------------------------------------------------
{{{
.include 'timer.pasm' # for the timer constants
.sub expired
say 'Timer has expired!'
exit 1
.end
.sub main :main
$P0 = new 'Timer'
$P1 = get_global "expired"
$P0[.PARROT_TIMER_HANDLER] = $P1 # call sub in $P1 when timer
goes off
$P0[.PARROT_TIMER_SEC] = 2 # trigger in 10 seconds
$P0[.PARROT_TIMER_REPEAT] = -1 # repeat indefinitely
$P0[.PARROT_TIMER_RUNNING] = 1 # start timer immediately
set_global "timer", $P0 # keep the timer around
$I0 = 0
loop:
print $I0
say ": running..."
inc $I0
sleep 1 # wait a second
goto loop
.end
}}}
This generates an illegal instruction. Changing the -1 to a positive one,
works as expected.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/484>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets