Fix botched disassembler backport

This commit is contained in:
2026-10-19 19:01:25 -05:00
parent 7ab5bd28bf
commit 6e9b727b31
3 changed files with 20 additions and 20 deletions
+17 -17
View File
@@ -5,28 +5,28 @@
#include <string.h>
#include <vbu.h>
/* Memory management */
#ifndef VBU_REALLOC
#include <stdlib.h>
#define VBU_REALLOC realloc
#else
extern void* VBU_REALLOC(void *, size_t);
#endif
/***************************** Library Functions *****************************/
/* Sign-extend an integer of variable width */
static int32_t SignExtend(int32_t value, int32_t bits) {
#ifndef VB_SIGNED_PROPAGATE
value &= ~((uint32_t) 0xFFFFFFFF << bits);
bits = (int32_t) 1 << (bits - (int32_t) 1);
return (value ^ bits) - bits;
#else
return value << (32 - bits) >> (32 - bits);
#endif
/* Memory manager */
#ifdef VBU_MEMMGR
extern void* VBU_MEMMGR(void *ptr, size_t size);
#else
#include <stdlib.h>
static void* VBU_MEMMGR(void *ptr, size_t size) {
/* Free a buffer */
if (size == 0) {
if (ptr != NULL)
free(ptr);
return NULL;
}
/* Create or resize a buffer */
return realloc(ptr, size);
}
#endif