From 8f0a9149536d951fc9d18e473d57a39efe3d9b7d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 25 Jan 2016 19:32:03 -0800 Subject: 2603 - bugfix: defining main with commandline args Pretty hacky fix: we simply suppress static dispatch for main. --- 062scheduler.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to '062scheduler.cc') diff --git a/062scheduler.cc b/062scheduler.cc index a68646d7..ca22caae 100644 --- a/062scheduler.cc +++ b/062scheduler.cc @@ -112,18 +112,17 @@ Current_routine = NULL; :(replace{} "void run_main(int argc, char* argv[])") void run_main(int argc, char* argv[]) { recipe_ordinal r = get(Recipe_ordinal, "main"); - if (r) { - routine* main_routine = new routine(r); - // pass in commandline args as ingredients to main - // todo: test this - Current_routine = main_routine; - for (long long int i = 1; i < argc; ++i) { - vector arg; - arg.push_back(new_mu_string(argv[i])); - current_call().ingredient_atoms.push_back(arg); - } - run(main_routine); + assert(r); + routine* main_routine = new routine(r); + // pass in commandline args as ingredients to main + // todo: test this + Current_routine = main_routine; + for (long long int i = 1; i < argc; ++i) { + vector arg; + arg.push_back(new_mu_string(argv[i])); + current_call().ingredient_atoms.push_back(arg); } + run(main_routine); } //:: To schedule new routines to run, call 'start-running'. -- cgit 1.4.1-2-gfad0