From e167fdf43cedea8b96690246734d652643fe1bd1 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 30 Nov 2015 00:19:11 -0800 Subject: bugfix after commit 2612 --- 060immutable.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/060immutable.cc b/060immutable.cc index 96e999dc..f57d7c23 100644 --- a/060immutable.cc +++ b/060immutable.cc @@ -31,6 +31,26 @@ recipe foo p:address:point -> p:address:point [ ] $warn: 0 +:(scenario ignore_literal_ingredients_for_immutability_checks) +% Hide_warnings = true; +recipe main [ + local-scope + p:address:d1 <- new d1:type + q:number <- foo p +] +recipe foo p:address:d1 -> q:number [ + local-scope + load-ingredients + x:address:d1 <- new d1:type + y:address:number <- get-address *x, p:offset # ignore this 'p' + q <- copy 34 +] +container d1 [ + p:number + q:number +] +$warn: 0 + :(scenario cannot_take_address_inside_immutable_ingredients) % Hide_warnings = true; recipe main [ @@ -246,6 +266,7 @@ bool is_present_in_ingredients(const recipe& callee, const string& ingredient_na set ingredient_indices(const instruction& inst, const set& ingredient_names) { set result; for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { + if (is_literal(inst.ingredients.at(i))) continue; if (ingredient_names.find(inst.ingredients.at(i).name) != ingredient_names.end()) result.insert(i); } -- cgit 1.4.1-2-gfad0