vm: add assertions to tls_vm()

db4
Slava Pestov 2009-10-02 09:37:04 -05:00
parent 805fea33cb
commit 96df486753
3 changed files with 12 additions and 8 deletions

View File

@ -33,7 +33,9 @@ void register_vm_with_thread(factor_vm *vm)
factor_vm *tls_vm() factor_vm *tls_vm()
{ {
return (factor_vm*)pthread_getspecific(tlsKey); factor_vm *vm = (factor_vm*)pthread_getspecific(tlsKey);
assert(vm != NULL);
return vm;
} }
static void *null_dll; static void *null_dll;

View File

@ -23,7 +23,9 @@ void register_vm_with_thread(factor_vm *vm)
factor_vm *tls_vm() factor_vm *tls_vm()
{ {
return (factor_vm*)TlsGetValue(dwTlsIndex); factor_vm *vm = (factor_vm*)TlsGetValue(dwTlsIndex);
assert(vm != NULL);
return vm;
} }
s64 current_micros() s64 current_micros()