vm: add assertions to tls_vm()

Slava Pestov 2009-10-02 09:37:04 -05:00
parent 06736767f4
commit 0497ade10b
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()
{
return (factor_vm*)pthread_getspecific(tlsKey);
factor_vm *vm = (factor_vm*)pthread_getspecific(tlsKey);
assert(vm != NULL);
return vm;
}
static void *null_dll;

View File

@ -23,7 +23,9 @@ void register_vm_with_thread(factor_vm *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()