nac3standalone: report when entry point run function cannot be found

This commit is contained in:
ychenfo 2021-11-11 23:44:57 +08:00
parent d336200bf4
commit aae9925014

View File

@ -100,7 +100,11 @@ fn main() {
let instance = { let instance = {
let defs = top_level.definitions.read(); let defs = top_level.definitions.read();
let mut instance = defs[resolver.get_identifier_def("run".into()).unwrap().0].write(); let mut instance =
defs[resolver
.get_identifier_def("run".into())
.unwrap_or_else(|| panic!("cannot find `run() -> int32 entry point`")).0
].write();
if let TopLevelDef::Function { if let TopLevelDef::Function {
instance_to_stmt, instance_to_stmt,
instance_to_symbol, instance_to_symbol,