if calloc() doesn't allocate memory for struct tvm_ctx, there may be NULL pointer dereferencing, i.e. vm->mem, vm->prog. So the vm pointer verification must be before it is used. Also, there is the same situation with vm->mem and stack creation. |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| tvm.c | ||
| tvm_file.c | ||
| tvm_htab.c | ||
| tvm_lexer.c | ||
| tvm_memory.c | ||
| tvm_parser.c | ||
| tvm_preprocessor.c | ||
| tvm_program.c | ||