summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-26 12:24:28 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-26 13:10:37 -0600
commitf92083c338069c5c22d200e4696d8cd908258492 (patch)
tree72d45999b7c470a07ad3d21f69519a699ddfe7c4 /src
parent6b30f3888e46c3981f1e4fc34c155c7539275420 (diff)
if we hit RET w/ empty call stack, halt
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/tgsi/exec/tgsi_exec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.c b/src/mesa/pipe/tgsi/exec/tgsi_exec.c
index 42aed9bd6b..0125f40dd2 100644
--- a/src/mesa/pipe/tgsi/exec/tgsi_exec.c
+++ b/src/mesa/pipe/tgsi/exec/tgsi_exec.c
@@ -2082,6 +2082,13 @@ exec_instruction(
if (mach->ExecMask == 0x0) {
/* really return now (otherwise, keep executing */
+ if (mach->CallStackTop == 0) {
+ /* returning from main() */
+ *pc = -1;
+ return;
+ }
+ *pc = mach->CallStack[--mach->CallStackTop];
+
/* pop the Cond, Loop, Cont stacks */
assert(mach->CondStackTop > 0);
mach->CondMask = mach->CondStack[--mach->CondStackTop];
@@ -2089,16 +2096,9 @@ exec_instruction(
mach->LoopMask = mach->LoopStack[--mach->LoopStackTop];
assert(mach->ContStackTop > 0);
mach->ContMask = mach->ContStack[--mach->ContStackTop];
-
assert(mach->FuncStackTop > 0);
mach->FuncMask = mach->FuncStack[--mach->FuncStackTop];
- assert(mach->CallStackTop >= 0);
- if (mach->CallStackTop == 0) {
- /* XXX error? */
- return;
- }
- *pc = mach->CallStack[--mach->CallStackTop];
UPDATE_EXEC_MASK(mach);
}
break;