From add4bd5eca136be775d49cb8b529254163ef2125 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 10 Aug 2010 22:15:33 -0700 Subject: [PATCH] compiler: additional sanity check for loadp --- orc/orccompiler.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/orc/orccompiler.c b/orc/orccompiler.c index 4a17d51..6980bb5 100644 --- a/orc/orccompiler.c +++ b/orc/orccompiler.c @@ -393,7 +393,15 @@ orc_compiler_check_sizes (OrcCompiler *compiler) opcode->name); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; return; - + } + if (opcode->flags & ORC_STATIC_OPCODE_SCALAR && + opcode->flags & ORC_STATIC_OPCODE_LOAD && + compiler->vars[insn->src_args[j]].vartype != ORC_VAR_TYPE_PARAM && + compiler->vars[insn->src_args[j]].vartype != ORC_VAR_TYPE_CONST) { + ORC_COMPILER_ERROR(compiler, "opcode %s requires const or param source", + opcode->name); + compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; + return; } } } -- 2.7.4