mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fixed asm parsing issue. Use of pointer as argument.
This commit is contained in:
@@ -1139,7 +1139,7 @@ static inline void llvm_emit_asm_block_stmt(GenContext *c, Ast *ast)
|
||||
result_types[result_count++] = llvm_get_type(c, decl->type);
|
||||
FOREACH_END();
|
||||
|
||||
FOREACH_BEGIN(ExprAsmArg * val, block->input)
|
||||
FOREACH_BEGIN(ExprAsmArg *val, block->input)
|
||||
BEValue value;
|
||||
codegen_new_constraint(&clobber_list);
|
||||
pointer_type[param_count] = NULL;
|
||||
|
||||
@@ -228,7 +228,12 @@ static inline bool parse_asm_addr(ParseContext *c, ExprAsmArg *asm_arg)
|
||||
if (type == TOKEN_MINUS) asm_arg->neg_offset = true;
|
||||
|
||||
// If it's an integer, then it's [foo + 123] or [foo - 213]
|
||||
if (tok_is(c, TOKEN_INTEGER)) return parse_asm_offset(c, asm_arg);
|
||||
if (tok_is(c, TOKEN_INTEGER))
|
||||
{
|
||||
if (!parse_asm_offset(c, asm_arg)) return false;
|
||||
CONSUME_OR_RET(TOKEN_RBRACKET, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Otherwise we expect the index.
|
||||
ASSIGN_EXPRID_OR_RET(asm_arg->idx, parse_asm_expr(c), false);
|
||||
|
||||
@@ -434,7 +434,7 @@ static inline bool sema_check_asm_arg_value(SemaContext *context, AsmInlineBlock
|
||||
return false;
|
||||
}
|
||||
Type *type = type_flatten(inner->type);
|
||||
if (type_is_pointer(type)) type = type_uptr;
|
||||
if (type_is_pointer(type)) type = type_uptr->canonical;
|
||||
if (type_is_integer(type))
|
||||
{
|
||||
if (!sema_reg_int_suported_type(arg_type, type))
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMPILER_VERSION "0.4.644"
|
||||
#define COMPILER_VERSION "0.4.645"
|
||||
Reference in New Issue
Block a user