X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cf108868b4eeed4d0d9d343bc68557d7814e18c0..2bcb5dd3317c733c31c288ae79e72fb28863d936:/src/mc/DwarfExpression.cpp diff --git a/src/mc/DwarfExpression.cpp b/src/mc/DwarfExpression.cpp index 6c90f3184a..86043a0bf9 100644 --- a/src/mc/DwarfExpression.cpp +++ b/src/mc/DwarfExpression.cpp @@ -4,13 +4,12 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include #include -#include #include #include -#include "src/mc/mc_object_info.h" #include "src/mc/mc_private.h" #include "src/mc/LocationList.hpp" #include "src/mc/AddressSpace.hpp" @@ -81,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): @@ -206,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; @@ -226,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;