aboutsummaryrefslogtreecommitdiffstats
path: root/src/v4/qv4v8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/v4/qv4v8.cpp')
-rw-r--r--src/v4/qv4v8.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/v4/qv4v8.cpp b/src/v4/qv4v8.cpp
index ce66109535..10de8c7327 100644
--- a/src/v4/qv4v8.cpp
+++ b/src/v4/qv4v8.cpp
@@ -337,11 +337,13 @@ Local<StackTrace> StackTrace::CurrentStackTrace(int frame_limit, StackTrace::Sta
VM::ExecutionContext **root = engine->contextStack;
VM::ExecutionContext **current = root + engine->contextStackPosition;
while (current >= root && frame_limit) {
- StackFrame *frame = new StackFrame(Value::fromVmValue(VM::Value::fromString(engine->id_null)),
- Value::fromVmValue(VM::Value::fromString((*current)->function ? (*current)->function->name : engine->id_null)),
- 0, 0);
- trace->frames.append(frame);
- --frame_limit;
+ if (CallContext *c = (*current)->asCallContext()) {
+ StackFrame *frame = new StackFrame(Value::fromVmValue(VM::Value::fromString(engine->id_null)),
+ Value::fromVmValue(VM::Value::fromString(c->function->name)),
+ 0, 0);
+ trace->frames.append(frame);
+ --frame_limit;
+ }
--current;
}