]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Temporary workaround for tempstring offset console spam in Xonotic.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 19 May 2020 14:06:35 +0000 (14:06 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 19 May 2020 14:06:35 +0000 (14:06 +0000)
Check if garbage collection is enabled before calling PRVM_GetString when handling OP_STORE_S or OP_STOREP_S

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12540 d7cf8633-e32d-0410-b094-e92efae38249

prvm_execprogram.h

index 256676e9bad58331d972bd2a2eadfc8c0deedbab..a6c45c98c47379dbada45e3111ef193b43626aa7 100644 (file)
@@ -1,3 +1,4 @@
+extern cvar_t prvm_garbagecollection_enable;
 // NEED to reset startst after calling this! startst may or may not be clobbered!
 #define ADVANCE_PROFILE_BEFORE_JUMP() \
        prog->xfunction->profile += (st - startst); \
                                // against a certain sort of repeated migration to earlier
                                // points in the scan that could otherwise result in the string
                                // being freed for being unused
-                               PRVM_GetString(prog, OPA->_int);
+                               if(prvm_garbagecollection_enable.integer)
+                                       PRVM_GetString(prog, OPA->_int);
                                OPB->_int = OPA->_int;
                        DISPATCH_OPCODE();
                        HANDLE_OPCODE(OP_STORE_V):
                                // against a certain sort of repeated migration to earlier
                                // points in the scan that could otherwise result in the string
                                // being freed for being unused
-                               PRVM_GetString(prog, OPA->_int);
+                               if(prvm_garbagecollection_enable.integer)
+                                       PRVM_GetString(prog, OPA->_int);
                                ptr = (prvm_eval_t *)(cached_edictsfields + OPB->_int);
                                ptr->_int = OPA->_int;
                                DISPATCH_OPCODE();