Skip to content

Commit f31cb0e

Browse files
committed
push old sha1/realloc changes
Not thoroughly tested so these features are not recommended for production use, but pushing these changes just in case.
1 parent f3df21b commit f31cb0e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/xc.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ SCAT,SCMP,SCCM,EXIT
434434
, ZZXC_loadfile
435435
, ZZXC_tsv_col_row
436436
, ZZXC_sha1
437+
, ZZXC_realloc
437438
/* directory */
438439
, ZZXC_DIR_EXISTS
439440
, ZZXC_DIR_ENTER
@@ -544,6 +545,7 @@ SCAT,SCMP,SCCM,EXIT
544545
" loadfile " \
545546
" tsv_col_row " \
546547
" sha1 " \
548+
" realloc " \
547549
/* directory */ \
548550
" dir_exists " \
549551
" dir_enter " \
@@ -650,6 +652,8 @@ SCAT,SCMP,SCCM,EXIT
650652
",FSTR" /* string_list_file */ \
651653
",LFIL" /* loadfile */ \
652654
",TVCR" /* tsv_col_row */ \
655+
",SHA1" /* sha1 */ \
656+
",RALC" /* realloc */ \
653657
/* directory */ \
654658
",DRXS" /* dir_exists */ \
655659
",DREN" /* dir_enter */ \
@@ -2533,6 +2537,21 @@ ZZXC_FUNC_INST_STR[op * 5]
25332537

25342538
ax = (int)strdup(readable);
25352539
}
2540+
2541+
/* load a file */
2542+
else if (op == ZZXC_realloc)
2543+
{
2544+
void *src = (void*)sp[1];
2545+
int len = (REGXC_INT)*sp;
2546+
void *result = realloc(src, len);
2547+
2548+
//fprintf(stderr, "realloc %p %p\n", src, len);
2549+
2550+
ax = (int)result;
2551+
2552+
if (!result)
2553+
die("[!] realloc memory error");
2554+
}
25362555

25372556
/* directory */
25382557
else if (op == ZZXC_DIR_EXISTS)

0 commit comments

Comments
 (0)