From 46ef8f19d76b33446c2ce6e7f1379bd348fe7fe4 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 12 Apr 2010 14:25:41 -0700 Subject: [PATCH] ir_reader: rvalues are instructions too! --- ir_reader.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ir_reader.cpp b/ir_reader.cpp index 0c41fb1..9eadce2 100644 --- a/ir_reader.cpp +++ b/ir_reader.cpp @@ -177,15 +177,17 @@ read_instruction(_mesa_glsl_parse_state *st, s_expression *expr) } ir_instruction *inst = NULL; - if (strcmp(tag->value(), "declare") == 0) + if (strcmp(tag->value(), "declare") == 0) { inst = read_declaration(st, list); - else if (strcmp(tag->value(), "if") == 0) + } else if (strcmp(tag->value(), "if") == 0) { inst = read_if(st, list); - else if (strcmp(tag->value(), "return") == 0) + } else if (strcmp(tag->value(), "return") == 0) { inst = read_return(st, list); - else - ir_read_error(expr, "unrecognized instruction tag: %s", tag->value()); - + } else { + inst = read_rvalue(st, list); + if (inst == NULL) + ir_read_error(list, "when reading instruction"); + } return inst; } -- 2.7.4