Fix string allocation issue for ARM eggs

This commit is contained in:
pancake 2015-09-02 00:18:55 +02:00
parent fbc6664511
commit c8cb347a41
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ enum {
LAST
};
#define eprintf(x,y...) (fprintf(stderr,"\x1b[33m"x"\x1b[0m",##y),1)
#define eprintf(x,y...) fprintf(stderr,"\x1b[33m"x"\x1b[0m",##y)
#define FREE(x) free(x); x=NULL
#define IS_VAR(x) (x[0]=='.'||((x[0]=='*'||x[0]=='&')&&x[1]=='.'))
#define MAX 255

View File

@ -64,8 +64,8 @@ static void emit_set_string(REgg *egg, const char *dstvar, const char *str, int
int rest, off = 0;
off = strlen (str)+1;
rest = (off%4);
if (rest) rest = 4-rest;
off += rest-8;
if (rest) rest = 4 - rest;
off += rest - 4;
r_egg_printf (egg, " add pc, $%d\n", (off));
// XXX: does not handle \n and so on.. must use r_util
r_egg_printf (egg, ".string \"%s\"\n", str);