Skip to content

Commit

Permalink
#74 bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Oct 16, 2021
1 parent aa0713f commit eba9803
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ast_simplify.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ static void process_expression(CompilerState *container, AstNode *node)
case EXPR_TABLE_LITERAL:
process_expression_list(container, node->table_expr.expr_list);
break;
case EXPR_BUILTIN:
break;
default:
assert(0);
break;
Expand Down
5 changes: 5 additions & 0 deletions src/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ static const char Lua_header[] =
"extern LClosure *luaF_newLclosure (lua_State *L, int n);\n"
"extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);\n"
"extern Proto *luaF_newproto (lua_State *L);\n"
"extern Udata *luaS_newudata (lua_State *L, size_t s);\n"
"extern void luaD_inctop (lua_State *L);\n"
"#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))\n"
"#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))\n"
Expand Down Expand Up @@ -3512,6 +3513,10 @@ static int emit_embedded_C_declarations(LinearizerState *linearizer, struct Ravi
analysis.is_tags = 0;
hashmap_foreach(&global_scope->vars, analyze_C_declarations, &analysis);

if (analysis.status == 0) {
raviX_buffer_add_string(mb, linearizer->C_declarations.buf);
}

Lexit:
if (analysis.status < 0 && parser.error_message) {
api->error_message(api->context, parser.error_message);
Expand Down

0 comments on commit eba9803

Please sign in to comment.