Reviewers: iposva, William Hesse,

Description:
Experimental: fix a bug in our compilation of switch statements.

As described in issue 241

http://code.google.com/p/v8/issues/detail?id=241

we can crash when compiling switch statements if we get into a state
where we are skipping comparisons (due to an unconditionally true
match) and still compiling bodies (due to continued fall-through) and
then hit a default case.

The issue is fixed by splitting the loop over the cases so that we do
not reuse the same loop code for both states (compiling comparisons
and skipping comparisons).

The code for the end of the switch has also been modified to avoid a
jump to the next statement for the last case (at the cost of extra
complexity to handle the new possible compilation states that arise).

Please review this at http://codereview.chromium.org/27200

SVN Base: http://v8.googlecode.com/svn/branches/experimental/toiger/

Affected files:
   M     src/codegen-ia32.cc



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to