Closed
Description
Tested with regex 0.2.1
println!("{:?}", RegexSet::new(&["a", "b",]).unwrap().is_match("b"));
println!("{:?}", RegexSet::new(&["b", "a",]).unwrap().is_match("b"));
println!("{:?}", RegexSet::new(&["a", "β",]).unwrap().is_match("β"));
println!("{:?}", RegexSet::new(&["β", "a",]).unwrap().is_match("β"));
gives
true
true
false
true
The third should also be true. The only difference of b
or β
leads to different results.
Activity
BurntSushi commentedon Apr 4, 2017
Interestingly, these work fine:
BurntSushi commentedon May 20, 2017
Found the problem. There appears to be a bug in the compiler that's producing incorrect bytecode specifically for
RegexSet
:The correct program should be:
My guess is that the extra
Match
instructions is somehow throwing things off, becausea|β
produces the correct program.compiler: fix RegexSet bug
Auto merge of #369 - rust-lang:ag-fix-353, r=BurntSushi
constituent commentedon May 21, 2017
I've tested with my original issue and it also works fine now. Thanks!