mirror of
https://github.com/corda/corda.git
synced 2025-03-12 15:34:58 +00:00
handle zero-length lookup tables in lookupswitch
This commit is contained in:
parent
db58097165
commit
61cb8b3deb
@ -2228,6 +2228,8 @@ throw_(MyThread* t, object o)
|
||||
t->exception = makeNullPointerException(t);
|
||||
}
|
||||
|
||||
// printTrace(t, t->exception);
|
||||
|
||||
unwind(t);
|
||||
}
|
||||
|
||||
@ -3811,6 +3813,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
|
||||
|
||||
int32_t pairCount = codeReadInt32(t, code, ip);
|
||||
|
||||
if (pairCount) {
|
||||
Compiler::Operand* start = 0;
|
||||
uint32_t ipTable[pairCount];
|
||||
for (int32_t i = 0; i < pairCount; ++i) {
|
||||
@ -3843,6 +3846,10 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
|
||||
|
||||
c->restoreState(state);
|
||||
}
|
||||
} else {
|
||||
// a switch statement with no cases, apparently
|
||||
c->jmp(default_);
|
||||
}
|
||||
|
||||
ip = defaultIp;
|
||||
} break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user