Project

Profile

Help

Bug #2807

closed

Operands of LocalParam

Added by Michael Kay almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2016-06-21
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7
Fixed in Maintenance Release:
Platforms:

Description

The LocalParam class has two Expression fields (select and conversion), and its operands() method constructs Operand objects on demand to wrap these expressions. This is incorrect, and has the consequence that if any rewrite methods alter the select or conversion expressions, the rewritten expression is used to update the transient Operand object which is then discarded, so the change does not take effect.

This can be seen in action on the 9.8 branch in test as-1216, where the initializer for a template parameter is converted to a global variable, but the global variable reference is not written back to the LocalParam object.

The correct design is for the Operand objects to be fields of the LocalParam and for the underlying Expression objects to be fetched when required.

Please register to edit this issue

Also available in: Atom PDF