]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Combine IF and GOTO handlers
authoruis <uis9936@gmail.com>
Mon, 13 May 2024 15:10:42 +0000 (18:10 +0300)
committeruis <uis9936@gmail.com>
Mon, 13 May 2024 15:10:42 +0000 (18:10 +0300)
prvm_execprogram.h

index f60f74ccee9c405beb6b5f037c807c14bf47fc9c..dedde967b1ba1c05fe84ed19aa9e141ef9edd012 100644 (file)
                                // although mostly unneeded, thanks to the only float being false being 0x0 and 0x80000000 (negative zero)
                                // and entity, string, field values can never have that value
                                {
+                                       HANDLE_OPCODE(INS_GOTO):
                                        ADVANCE_PROFILE_BEFORE_JUMP();
                                        st = cached_statements + st->jumpabsolute - 1;  // offset the st++
                                        startst = st;
                                }
                                DISPATCH_OPCODE();
 
-                       HANDLE_OPCODE(INS_GOTO):
-                               ADVANCE_PROFILE_BEFORE_JUMP();
-                               st = cached_statements + st->jumpabsolute - 1;  // offset the st++
-                               startst = st;
-                               // no bounds check needed, it is done when loading progs
-                               if (++jumpcount == 10000000 && prvm_runawaycheck)
-                               {
-                                       prog->xstatement = st - cached_statements;
-                                       PRVM_Profile(prog, 1<<30, 0.01, 0);
-                                       prog->error_cmd("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", prog->name, jumpcount);
-                               }
-                               DISPATCH_OPCODE();
-
                        HANDLE_OPCODE(INS_CALL):
 #ifdef PRVMTIMEPROFILING 
                                tm = Sys_DirtyTime();