From c1297a364b233375aa790e4440719e958c800892 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 22 Feb 2015 00:29:45 -0800 Subject: 816 --- cpp/017record | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/017record b/cpp/017record index 3f5d9889..89516672 100644 --- a/cpp/017record +++ b/cpp/017record @@ -34,6 +34,7 @@ case GET: { trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name; int base_address = to_int(instructions[pc].ingredients[0].name); int base_type = instructions[pc].ingredients[0].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 @@ -109,6 +110,8 @@ Next_recipe_number++; case GET_ADDRESS: { trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name; int base_address = to_int(instructions[pc].ingredients[0].name); + int base_type = instructions[pc].ingredients[0].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 -- cgit 1.4.1-2-gfad0