]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - execloop.h
same +1 offset in LOAD_V as STOREP fixed
[xonotic/gmqcc.git] / execloop.h
index 3b6d666f4877d03738dc3bb5713c715e54f1e608..b75061e50b4633637e8d068c3c8a08305b7798e3 100644 (file)
@@ -16,7 +16,7 @@
 #endif
 
 #if !defined(PRVM_ERROR)
-#   define PRVM_ERROR printf
+#   define PRVM_ERROR prog->vmerror++, printvmerr
 #endif
 
 #if !defined(PRVM_NAME)
                                ptr->_int = OPA->_int;
                                break;
                        case INSTR_STOREP_V:
-                               if (OPB->_int < 0 || OPB->_int + 3 >= prog->entitydata_count)
+                               if (OPB->_int < 0 || OPB->_int + 2 >= prog->entitydata_count)
                                {
                                        PRVM_ERROR("%s attempted to write to an out of bounds edict (%i)", PRVM_NAME, OPB->_int);
                                        goto cleanup;
                        case INSTR_ADDRESS:
                                if (OPA->edict < 0 || OPA->edict >= prog->entities)
                                {
-                                       PRVM_ERROR ("%s Progs attempted to address an out of bounds edict number", PRVM_NAME);
+                                       PRVM_ERROR ("%s Progs attempted to address an out of bounds edict number %i", PRVM_NAME, OPA->edict);
                                        goto cleanup;
                                }
                                if ((unsigned int)(OPB->_int) >= (unsigned int)(prog->entityfields))
                                        PRVM_ERROR ("%s Progs attempted to read an out of bounds edict number", PRVM_NAME);
                                        goto cleanup;
                                }
-                               if (OPB->_int < 0 || OPB->_int + 3 >= prog->entityfields)
+                               if (OPB->_int < 0 || OPB->_int + 3 > prog->entityfields)
                                {
                                        PRVM_ERROR("%s attempted to read an invalid field in an edict (%i)", PRVM_NAME, OPB->_int);
                                        goto cleanup;
                                }
                                else
                                        st = prog->code + PROG_ENTERFUNCTION(newf);
+                               if (prog->vmerror)
+                                   goto cleanup;
                                break;
 
                        case INSTR_DONE: