-
-
Save crowell/6cae90fdeb3810d3f695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/libr/anal/esil.c b/libr/anal/esil.c | |
index 7b5cf2d..0ff8a72 100644 | |
--- a/libr/anal/esil.c | |
+++ b/libr/anal/esil.c | |
@@ -1988,14 +1988,16 @@ static int esil_dup(RAnalEsil *esil) { | |
} | |
static int esil_swap (RAnalEsil *esil) { | |
- char *tmp; | |
+ char *tmp1; | |
+ char *tmp2; | |
if (!esil || !esil->stack || esil->stackptr < 2) | |
return false; | |
- if (!esil->stack[esil->stackptr] || !esil->stack[esil->stackptr-1]) | |
+ if (!esil->stack[esil->stackptr-1] || !esil->stack[esil->stackptr-2]) | |
return false; | |
- tmp = esil->stack[esil->stackptr]; | |
- esil->stack[esil->stackptr] = esil->stack[esil->stackptr-1]; | |
- esil->stack[esil->stackptr-1] = tmp; | |
+ tmp1 = r_anal_esil_pop (esil); | |
+ tmp2 = r_anal_esil_pop (esil); | |
+ r_anal_esil_push (esil, tmp1); | |
+ r_anal_esil_push (esil, tmp2); | |
return true; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment