Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix an undefined C behavior.
[simgrid.git] / src / mc / DwarfExpression.cpp
index 6cdba68..03298eb 100644 (file)
@@ -225,9 +225,12 @@ 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());