From 35acc33ef618c228ff25f359f411033084d82edd Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 16 Dec 2015 13:56:49 +0800 Subject: [PATCH] validators.escape: don't fail on quoted values in lhs. --- artiq/compiler/validators/escape.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/validators/escape.py b/artiq/compiler/validators/escape.py index 2b596cdd7..2e8438f88 100644 --- a/artiq/compiler/validators/escape.py +++ b/artiq/compiler/validators/escape.py @@ -268,8 +268,12 @@ class EscapeValidator(algorithm.Visitor): if region is not None: region.contract(value_region) + # If we assign to an attribute of a quoted value, there will be no names + # in the assignment lhs. + target_names = self._names_of(target) or [] + # The assigned value should outlive the assignee - target_regions = [self._region_of(name) for name in self._names_of(target)] + target_regions = [self._region_of(name) for name in target_names] for target_region in target_regions: if not Region.outlives(value_region, target_region): if is_aug_assign: