From c82d01762778baeb71c26365479e3c1cddcfbf13 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 26 Mar 2015 17:03:07 -0700 Subject: 973 --- cpp/019address | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cpp/019address') diff --git a/cpp/019address b/cpp/019address index 28fa4515..a642ceb1 100644 --- a/cpp/019address +++ b/cpp/019address @@ -15,7 +15,7 @@ recipe main [ :(replace{} "vector read_memory(reagent x)") vector read_memory(reagent x) { vector result; - if (x.types[0] == 0) { // literal + if (isa_literal(x)) { result.push_back(x.value); return result; } @@ -133,8 +133,7 @@ case GET: { int base_type = base.types[0]; assert(Type[base_type].is_record); trace("run") << "ingredient 1 is " << instructions[pc].ingredients[1].name; - assert(instructions[pc].ingredients[1].types.size() == 1); - assert(instructions[pc].ingredients[1].types[0] == 0); // must be literal + assert(isa_literal(instructions[pc].ingredients[1])); size_t offset = instructions[pc].ingredients[1].value; int src = base_address; for (size_t i = 0; i < offset; ++i) { @@ -176,8 +175,7 @@ case GET_ADDRESS: { int base_type = base.types[0]; assert(Type[base_type].is_record); trace("run") << "ingredient 1 is " << instructions[pc].ingredients[1].name; - assert(instructions[pc].ingredients[1].types.size() == 1); - assert(instructions[pc].ingredients[1].types[0] == 0); // must be literal + assert(isa_literal(instructions[pc].ingredients[1])); size_t offset = instructions[pc].ingredients[1].value; int src = base_address; for (size_t i = 0; i < offset; ++i) { -- cgit 1.4.1-2-gfad0