develooper Front page | perl.perl5.porters | Postings from May 2008

div by zero folding deferred to run-time

Thread Next
From:
Eric Brine
Date:
May 16, 2008 11:54
Subject:
div by zero folding deferred to run-time
Message ID:
f86994700805160757i338388b8t8a85253280fb7715@mail.gmail.com
Hello,
Division by zero exceptions that occur during constant folding are
being deferred to run-time. Is that intentional or is that a
regression?
Eric Brine


** 5.8.8, Exception during constant folding: **

>c:\progs\perl588\bin\perl -MO=Concise -e"1/0"
Illegal division by zero at -e line 1.


** 5.10.0, Exception deferred to run-time: **

>c:\progs\perl5100\bin\perl -MO=Concise -e"1/0"

6  <@> leave[1 ref] vKP/REFC ->(end)
1     <0> enter ->2
2     <;> nextstate(main 1 -e:1) v:{ ->3
5     <2> divide[t1] vK/2 ->6
3        <$> const[PVNV 1] s ->4
4        <$> const[PVNV 0] s ->5
-e syntax OK

>c:\progs\perl5100\bin\perl -e"1/0"
Illegal division by zero at -e line 1.


** 5.10.0 still folds other constants: **

>c:\progs\perl5100\bin\perl -MO=Concise -e"1/2"

3  <@> leave[1 ref] vKP/REFC ->(end)
1     <0> enter ->2
2     <;> nextstate(main 1 -e:1) v:{ ->3
-     <0> ex-const v ->3
-e syntax OK


This is perl, v5.8.8 built for MSWin32-x86-multi-thread
Binary build 817 [257965] provided by ActiveState

This is perl, v5.10.0 built for MSWin32-x86-multi-thread
Binary build 1001 [283495] provided by ActiveState

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About