Skip to content
Snippets Groups Projects
Commit 9bf3663b authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

rts/Interpreter: Assert that TEST*_P discriminators are valid

parent 0e084029
No related branches found
No related tags found
No related merge requests found
......@@ -1785,6 +1785,7 @@ run_BCO:
case bci_TESTLT_P: {
unsigned int discr = BCO_NEXT;
int failto = BCO_GET_LARGE_ARG;
ASSERT(discr <= TAG_MASK);
StgClosure* con = UNTAG_CLOSURE((StgClosure*)SpW(0));
if (GET_TAG(con) >= discr) {
bciPtr = failto;
......@@ -1795,6 +1796,7 @@ run_BCO:
case bci_TESTEQ_P: {
unsigned int discr = BCO_NEXT;
int failto = BCO_GET_LARGE_ARG;
ASSERT(discr <= TAG_MASK);
StgClosure* con = UNTAG_CLOSURE((StgClosure*)SpW(0));
if (GET_TAG(con) != discr) {
bciPtr = failto;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment