Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2014-02-11 22:14:58 -0500
committerEugene Tarassov2014-02-11 22:14:58 -0500
commit7e248442f8db5b745e3ef2326dcb68b06087feb2 (patch)
tree9e495e5af4d4cd2343e15917f6976ba9cce76f5e
parent01e02e9f5bc5b8621e71e39f2e18f81b5ccbe2dd (diff)
downloadorg.eclipse.tcf.agent-7e248442f8db5b745e3ef2326dcb68b06087feb2.tar.gz
org.eclipse.tcf.agent-7e248442f8db5b745e3ef2326dcb68b06087feb2.tar.xz
org.eclipse.tcf.agent-7e248442f8db5b745e3ef2326dcb68b06087feb2.zip
TCF Agent: fixed: possible seg fault if an error found during evaluation of DWARF expression
-rw-r--r--agent/tcf/services/vm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/agent/tcf/services/vm.c b/agent/tcf/services/vm.c
index e0889418..c805d902 100644
--- a/agent/tcf/services/vm.c
+++ b/agent/tcf/services/vm.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
@@ -640,12 +640,14 @@ static void evaluate_expression(void) {
size = read_u8leb128();
if (size == 0 || (n >= addr && n - addr < size)) {
Trap trap;
+ LocationExpressionState * s = state;
size_t code_len_org = code_len;
if (set_trap(&trap)) {
code_len = state->code_len = nxt_pos;
evaluate_expression();
clear_trap(&trap);
}
+ state = s;
code_len = state->code_len = code_len_org;
if (trap.error) exception(trap.error);
break;

Back to the top