From 009218c6f954ca10f87ad2703f9afe86a23cabaf Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Wed, 3 Jan 2024 21:59:40 +0100 Subject: [PATCH] error on unknown function --- src/vm/src/Compiler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vm/src/Compiler.cpp b/src/vm/src/Compiler.cpp index 12cb2d5..9bf2db1 100644 --- a/src/vm/src/Compiler.cpp +++ b/src/vm/src/Compiler.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include "Command.h" @@ -131,6 +132,7 @@ Handle Compiler::compile(const Handle &src, Handle fake_env, const Handle &suffi out.append(make_cmd(LD)); Handle idx = findIndex(car, fake_env); + if (idx.null()) throw std::invalid_argument("Could not find function to apply: " + std::string(car.strval())); out.append(idx); out.append(make_cmd(AP)); }