mesa: added some assertions in BNGLOOP/ENDLOOP cases
authorBrian Paul <brianp@vmware.com>
Tue, 22 Dec 2009 19:57:31 +0000 (12:57 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 22 Dec 2009 21:26:06 +0000 (14:26 -0700)
src/mesa/shader/prog_execute.c

index 038ce0b4f0029fd0cf2780527b8b684d9cf9241b..025665a06e59871bb710df4b53e4f136eba82ecd 100644 (file)
@@ -684,9 +684,13 @@ _mesa_execute_program(GLcontext * ctx,
          break;
       case OPCODE_BGNLOOP:
          /* no-op */
+         ASSERT(program->Instructions[inst->BranchTarget].Opcode
+                == OPCODE_ENDLOOP);
          break;
       case OPCODE_ENDLOOP:
          /* subtract 1 here since pc is incremented by for(pc) loop */
+         ASSERT(program->Instructions[inst->BranchTarget].Opcode
+                == OPCODE_BGNLOOP);
          pc = inst->BranchTarget - 1;   /* go to matching BNGLOOP */
          break;
       case OPCODE_BGNSUB:      /* begin subroutine */