diff options
| author | Brian <brian@yutani.localnet.net> | 2007-03-27 11:02:20 -0600 | 
|---|---|---|
| committer | Brian <brian@yutani.localnet.net> | 2007-03-27 16:06:47 -0600 | 
| commit | a0275b0d2c071ed8254c2af3a0c53eec9d3561a6 (patch) | |
| tree | 17c50d80a0ed4c4dc2ef5fd4591055cbf55c4401 /src | |
| parent | d6d6d20b137b23c1c28ca64f7781213f7df36e9a (diff) | |
fix off by one error in OPCODE_RET
Diffstat (limited to 'src')
| -rw-r--r-- | src/mesa/shader/prog_execute.c | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index f881d477ca..37240820e7 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -752,8 +752,8 @@ _mesa_execute_program(GLcontext * ctx,              if (machine->StackDepth >= MAX_PROGRAM_CALL_DEPTH) {                 return GL_TRUE;  /* Per GL_NV_vertex_program2 spec */              } -            machine->CallStack[machine->StackDepth++] = pc + 1; -            pc = inst->BranchTarget;    /* XXX - 1 ??? */ +            machine->CallStack[machine->StackDepth++] = pc + 1; /* next inst */ +            pc = inst->BranchTarget;           }           break;        case OPCODE_CMP: @@ -1305,7 +1305,8 @@ _mesa_execute_program(GLcontext * ctx,              if (machine->StackDepth == 0) {                 return GL_TRUE;  /* Per GL_NV_vertex_program2 spec */              } -            pc = machine->CallStack[--machine->StackDepth]; +            /* subtract one because of pc++ in the for loop */ +            pc = machine->CallStack[--machine->StackDepth] - 1;           }           break;        case OPCODE_RFL:         /* reflection vector */ | 
