From c9c2b0c5411a9b3cfd11013021e4017eea5425c4 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 24 Oct 2012 10:09:30 +0200 Subject: [PATCH] Fix LLVM backend compilation. Change-Id: I326cf2531a600fd09b888e9955052b29624ccdbe Reviewed-by: Lars Knoll --- main.cpp | 9 ++++++--- qv4isel_llvm.cpp | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index f5f51c3..bdd5b37 100644 --- a/main.cpp +++ b/main.cpp @@ -169,15 +169,18 @@ int evaluateCompiledCode(const QStringList &files) globalObject->setProperty(ctx, vm.identifier(QStringLiteral("print")), QQmlJS::VM::Value::fromObject(new builtins::Print(ctx))); - code(ctx); - - if (ctx->hasUncaughtException) { + void * buf = __qmljs_create_exception_handler(ctx); + if (setjmp(*(jmp_buf *)buf)) { if (VM::ErrorObject *e = ctx->result.asErrorObject()) std::cerr << "Uncaught exception: " << qPrintable(e->value.toString(ctx)->toQString()) << std::endl; else std::cerr << "Uncaught exception: " << qPrintable(ctx->result.toString(ctx)->toQString()) << std::endl; + return -2; } + + code(ctx); } + return 0; } diff --git a/qv4isel_llvm.cpp b/qv4isel_llvm.cpp index 040111f..9e35e6e 100644 --- a/qv4isel_llvm.cpp +++ b/qv4isel_llvm.cpp @@ -935,7 +935,9 @@ void LLVMInstructionSelection::genCallName(IR::Call *e, llvm::Value *result) _llvmValue = llvm::UndefValue::get(_valueTy); return; - Q_UNREACHABLE(); + default: + Q_UNREACHABLE(); + } } else { llvm::Value *name = getIdentifier(*base->id); -- 2.7.4