error.setLine(line); \
error.setUrl(comp->url); \
vmeErrors << error; \
- break; \
+ goto exceptionExit; \
}
struct ListInstance
instructionStream += QDeclarativeInstructionMeta<(int)QDeclarativeInstruction::I>::Size; \
Q_UNUSED(instr);
+#define QML_NEXT_INSTR(I) break;
#define QML_END_INSTR(I) } break;
#define CLEAN_PROPERTY(o, index) if (fastHasBinding(o, index)) removeBindingOnProperty(o, index)
const char *instructionStream = comp->bytecode.constData() + start;
- bool done = false;
- while (!isError() && !done) {
+ for (;;) {
const QDeclarativeInstruction &genericInstr = *((QDeclarativeInstruction *)instructionStream);
switch(genericInstr.type()) {
QML_END_INSTR(Init)
QML_BEGIN_INSTR(Done)
- done = true;
+ goto normalExit;
QML_END_INSTR(Done)
QML_BEGIN_INSTR(CreateObject)
int coreIndex = mp.index();
if ((stack.count() - instr.owner) == 1 && bindingSkipList.testBit(coreIndex))
- break;
+ QML_NEXT_INSTR(StoreBinding);
QDeclarativeBinding *bind = new QDeclarativeBinding(primitives.at(instr.value), true,
context, ctxt, comp->name, instr.line);
int coreIndex = mp.index();
if ((stack.count() - instr.owner) == 1 && bindingSkipList.testBit(coreIndex))
- break;
+ QML_NEXT_INSTR(StoreBindingOnAlias);
QDeclarativeBinding *bind = new QDeclarativeBinding(primitives.at(instr.value), true,
context, ctxt, comp->name, instr.line);
int property = instr.property;
if (stack.count() == 1 && bindingSkipList.testBit(property & 0xFFFF))
- break;
+ QML_NEXT_INSTR(StoreV4Binding);
QDeclarativeAbstractBinding *binding =
ctxt->v4bindings->configBinding(instr.value, target, scope, property);
int coreIndex = mp.index();
if ((stack.count() - instr.owner) == 1 && bindingSkipList.testBit(coreIndex))
- break;
+ QML_NEXT_INSTR(StoreV8Binding);
QDeclarativeAbstractBinding *binding =
ctxt->v8bindings->configBinding(instr.value, target, scope, mp, instr.line);
}
}
- if (isError()) {
- if (!stack.isEmpty()) {
- delete stack.at(0); // ### What about failures in deferred creation?
- } else {
- ctxt->destroy();
- }
-
- QDeclarativeEnginePrivate::clear(bindValues);
- QDeclarativeEnginePrivate::clear(parserStatus);
- return 0;
+ exceptionExit:
+ Q_ASSERT(isError());
+ if (!stack.isEmpty()) {
+ delete stack.at(0); // ### What about failures in deferred creation?
+ } else {
+ ctxt->destroy();
}
+ QDeclarativeEnginePrivate::clear(bindValues);
+ QDeclarativeEnginePrivate::clear(parserStatus);
+ return 0;
+
+ normalExit:
if (bindValues.count)
ep->bindValues << bindValues;
else if (bindValues.values)