Tcl Source Code

View Ticket
Login
Ticket UUID: 3614360
Title: return in expr mangles the stack
Type: Bug Created on: 2013-06-05 21:22:32
Submitter: dkf Assigned to: dgp
Subsystem: 47. Bytecode Compiler Severity:
Priority: 9 Immediate Last modified: 2013-06-06 21:24:59
Status: Closed Closed by: dgp
Resolution: Fixed Closed on: 2013-06-06 14:24:59
Version: current: 8.6.0
Description:
This crashes in a full debug build (without the optimizer work I'm going to commit very soon):
  apply {{} {expr {[return foo] + $a + $b}}}

Error is:
  bad stack adjustment when compiling expr (was 0 instead of 1)

I believe (from scanning the fossil history) that you may have fixed something in this area. (Note that I don't know what bytecode sequence is generated; disassembling hits the same panic.)
User Comments:
dgp added on 2013-06-06 20:19:51:
Yes, I have a fix for this one over in mig-review.  Will port it over shortly.

dgp added on 2013-06-06 20:44:00:
Hmmm... the fix isn't quite as isolated as I thought, but it will
come over when I bring the fixes collected over there to the trunk.

dgp added on 2013-06-06 21:24:59:

allow_comments - 1

Aha!  It was isolated, I just had the wrong bit.

Fixed on trunk.