diff --git a/sourcepawn/vm/sp_vm.c b/sourcepawn/vm/sp_vm.c index b795ed06..b1ec091c 100644 --- a/sourcepawn/vm/sp_vm.c +++ b/sourcepawn/vm/sp_vm.c @@ -258,7 +258,7 @@ int SP_BindNatives(sp_context_t *ctx, sp_nativeinfo_t *natives, unsigned int num for (i=0; inatives[i].status == SP_NATIVE_OKAY && !overwrite) + if ((ctx->natives[i].status == SP_NATIVE_OKAY) && !overwrite) continue; for (j=0; (natives[j].name) && (!num || j= ctx->hp) && (local_addr < ctx->sp)) || (local_addr < 0) || ((ucell_t)local_addr >= ctx->memory)) + return SP_ERR_INVALID_ADDRESS; + + if (phys_addr) + *phys_addr = (cell_t *)(ctx->data + local_addr); + return SP_ERR_NONE; } \ No newline at end of file