Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / mc / DwarfExpression.cpp
index 35017da..86043a0 100644 (file)
@@ -80,7 +80,7 @@ void execute(
         break;
       }
 
-      // Push the CFA (Canonical Frame Addresse):
+      // Push the CFA (Canonical Frame Address):
     case DW_OP_call_frame_cfa:
       {
         /* See 6.4 of DWARF4 (http://dwarfstd.org/doc/DWARF4.pdf#page=140):
@@ -205,13 +205,19 @@ void execute(
       // and replace the top of the stack with the computed value
       // (stack.top() += stack.before_top()).
 
-    case DW_OP_plus:
-      stack.push(stack.pop() + stack.pop());
+    case DW_OP_plus: {
+      intptr_t first = stack.pop();
+      intptr_t second = stack.pop();
+      stack.push(first + second);
       break;
+    }
 
-    case DW_OP_mul:
-      stack.push(stack.pop() * stack.pop());
+    case DW_OP_mul: {
+      intptr_t first = stack.pop();
+      intptr_t second = stack.pop();
+      stack.push(first * second);
       break;
+    }
 
     case DW_OP_plus_uconst:
       stack.top() += op->number;
@@ -225,21 +231,33 @@ void execute(
       stack.top() = - (intptr_t) stack.top();
       break;
 
-    case DW_OP_minus:
-      stack.push(stack.pop() - stack.pop());
+    case DW_OP_minus: {
+      intptr_t first = stack.pop();
+      intptr_t second = stack.pop();
+      stack.push(second - first);
       break;
+    }
 
-    case DW_OP_and:
-      stack.push(stack.pop() & stack.pop());
+    case DW_OP_and: {
+      intptr_t first = stack.pop();
+      intptr_t second = stack.pop();
+      stack.push(first & second);
       break;
+    }
 
-    case DW_OP_or:
-      stack.push(stack.pop() | stack.pop());
+    case DW_OP_or: {
+      intptr_t first = stack.pop();
+      intptr_t second = stack.pop();
+      stack.push(first | second);
       break;
+    }
 
-    case DW_OP_xor:
-      stack.push(stack.pop() ^ stack.pop());
+    case DW_OP_xor: {
+      intptr_t first = stack.pop();
+      intptr_t second = stack.pop();
+      stack.push(first ^ second);
       break;
+    }
 
     case DW_OP_nop:
       break;