bugfix with some addresses
@@ -350,7 +350,7 @@ static preg *pconst( preg *r, int c ) {
static preg *pconst64( preg *r, int_val c ) {
#ifdef HL_64
- if( (c&0xFFFFFFFF) == c )
+ if( ((int)c) == c )
return pconst(r,(int)c);
r->kind = RCONST;
r->id = 0xC064C064;
@@ -4241,6 +4241,10 @@ void hl_jit_patch_method( void *old_fun, void **new_fun_table ) {
*b++ = 0x20;
}
+static void missing_closure() {
+ hl_error("Missing static closure");
+}
+
void *hl_jit_code( jit_ctx *ctx, hl_module *m, int *codesize, hl_debug_infos **debug, hl_module *previous ) {
jlist *c;
int size = BUF_POS();
@@ -4311,7 +4315,8 @@ void *hl_jit_code( jit_ctx *ctx, hl_module *m, int *codesize, hl_debug_infos **d
// read absolute address from previous module
int old_idx = m->hash->functions_hashes[m->functions_indexes[fidx]];
if( old_idx < 0 )
- return NULL;
+ fabs = missing_closure;
+ else
fabs = previous->functions_ptrs[(previous->code->functions + old_idx)->findex];
} else {
// relative
