should generate a branch under the hash to deal with the conflicting values
Environment
None
Attachments
1
Activity
Stuart Halloway April 27, 2011 at 2:01 AM
code now passes test.generative tests. Test run shows case to be faster than cond (and test code could be improved to more directly compare speed).
This is a fairly large patch – please advise if we need to find a way to break into into smaller chunks, or if there are other perf tests you would like to see.
Alexander Taggart April 22, 2011 at 8:14 PM
Updated patch to fix above.
Explanation of bug:
When multiple test constants have a hash collision, the respective thens are combined with a condp, and the colliding hash value is used as the test constant. Since the combined then performs its own post-switch validation, the normal (non-colliding) behaviour of checking that the original test value equals the tested expression must be skipped.
The bug occurred because the skip-check set of case ints was not getting the necessary shift-mask applied to it.
The bug was not caught earlier because there was incomplete test coverage, namely, for the case of both hash collision and shift-mask application.
Stuart Halloway April 22, 2011 at 5:48 PM
I am seeing failure for the following input:
Sorry for the screwy formatting in JIRA.
Christopher Redinger April 21, 2011 at 6:17 PM
FYI: patch applies cleanly & tests pass against master as of 4/21 (2011)
should generate a branch under the hash to deal with the conflicting values