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

List:       perl6-internals
Subject:    Re: [perl #43048] imcc constant folding div by zero bug
From:       Jonathan Worthington <jonathan () jnthn ! net>
Date:       2007-05-27 14:20:34
Message-ID: 465993B2.5030506 () jnthn ! net
[Download RAW message or body]

Will Coleda (via RT) wrote:
> This doesn't:
>
> .sub zero_check
>
>    push_eh one
>      $N1 = 3 / 0.0
>
> <snip>
>
> Guessing that imcc is doing constant folding without the guards that  
> the ops use.
>   
Aye, and the trouble is, I think, that we don't actually have ops that 
only take two constants; if I remember correctly, they were tossed in 
favor of the folding inside IMCC.

I suspect you need to detect conditions like this and either emit 
something more like:

$N99999 = 3.0
$N1 = $N99999 / 0

Since we do have ops like this. Less ugly solutions preferred (still a 
tiny bit lagged from my travels).

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

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