[squeak-dev] The Inbox: Compiler-ct.463.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Nov 16 11:41:01 UTC 2021

A new version of Compiler was added to project The Inbox:

==================== Summary ====================

Name: Compiler-ct.463
Author: ct
Time: 16 November 2021, 12:40:59.711376 pm
UUID: 8f758ee8-125c-d54d-b581-72ab467f92ae
Ancestors: Compiler-eem.460

Fixes a DNU in the decompiler when the stack contains flags (such as CaseFlag) while trying to match a #to:[by:]do: loop. Can be reproduced with String >> #format: ct 12/7/2019 15:05 (Collections-ct.867).

=============== Diff against Compiler-eem.460 ===============

Item was changed:
  ----- Method: Decompiler>>startAndLimitFor:from:into: (in category 'private') -----
  startAndLimitFor: incrVar from: aStack into: binaryBlock
  	"If incrVar matches the increment of a whileLoop at the end of statements
  	 evaluate binaryBlock with the init statement for incrVar and the init statement
  	 for the block's limit, if any, and answer true.  Otherwise answer false.  Used to
  	 help convert whileTrue: loops into to:[by:]do: loops."
  	| guard initExpr limitInit size |
  	((size := aStack size) >= 1
+ 	 and: [(initExpr := aStack at: size) isKindOf: ParseNode]
+ 	 and: [initExpr isAssignmentNode]) ifFalse:
- 	 and: [(initExpr := aStack at: size) isAssignmentNode]) ifFalse:
  	initExpr variable == incrVar ifTrue:
  		[binaryBlock value: initExpr value: nil.
  	limitInit := initExpr.
  	(size >= 2
+ 	 and: [((initExpr := aStack at: size - 1) isKindOf: ParseNode)
+ 	 and: [initExpr isAssignmentNode
+ 	 and: [initExpr variable == incrVar]
- 	 and: [(initExpr := aStack at: size - 1) isAssignmentNode
- 	 and: [initExpr variable == incrVar
  	 and: [(guard := statements last receiver) isBlockNode
  	 and: [guard statements size = 1
  	 and: [(guard := guard statements first) isMessageNode
  	 and: [guard receiver == incrVar
  	 and: [guard arguments first == limitInit variable]]]]]]]) ifTrue:
  		[binaryBlock value: initExpr value: limitInit.

More information about the Squeak-dev mailing list