@@ -259,16 +259,22 @@ CompilerValue *Compiler::addInput(Input *input)
259259 impl->block = input->valueBlock ();
260260
261261 if (impl->block ) {
262- if (impl->block ->compileFunction ())
262+ if (impl->block ->compileFunction ()) {
263263 ret = impl->block ->compile (this );
264- else {
264+
265+ if (!ret) {
266+ std::cout << " warning: the compile function of '" << impl->block ->opcode () << " ' returns null" << std::endl;
267+ ret = addConstValue (Value ());
268+ }
269+ } else {
265270 std::cout << " warning: unsupported reporter block: " << impl->block ->opcode () << std::endl;
266271 impl->unsupportedBlocks .insert (impl->block ->opcode ());
267272 ret = addConstValue (Value ());
268273 }
269274 } else
270275 ret = addConstValue (input->primaryValue ()->value ());
271276
277+ assert (ret);
272278 impl->block = previousBlock;
273279 return ret;
274280 }
@@ -280,16 +286,28 @@ CompilerValue *Compiler::addInput(Input *input)
280286 impl->block = input->valueBlock ();
281287
282288 if (impl->block ) {
283- if (impl->block ->compileFunction ())
289+ if (impl->block ->compileFunction ()) {
284290 ret = impl->block ->compile (this );
285- else {
291+
292+ if (!ret) {
293+ std::cout << " warning: the compile function of '" << impl->block ->opcode () << " ' returns null" << std::endl;
294+ ret = addConstValue (Value ());
295+ }
296+ } else {
286297 std::cout << " warning: unsupported reporter block: " << impl->block ->opcode () << std::endl;
287298 impl->unsupportedBlocks .insert (impl->block ->opcode ());
288299 ret = addConstValue (Value ());
289300 }
290- } else
301+ } else {
291302 ret = input->primaryValue ()->compile (this );
292303
304+ if (!ret) {
305+ std::cout << " warning: input '" << input->name () << " ' compiles to null" << std::endl;
306+ ret = addConstValue (Value ());
307+ }
308+ }
309+
310+ assert (ret);
293311 impl->block = previousBlock;
294312 return ret;
295313 }
0 commit comments