Skip to content

Commit

Permalink
Fix bug with function prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorious3 committed Aug 27, 2023
1 parent 5089a48 commit b31d748
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compiler.pr
Original file line number Diff line number Diff line change
Expand Up @@ -2667,6 +2667,7 @@ def insert_call(
multiple_returns: bool, state: &State) {

for var i in 0..args.size {
if i >= proto.size { continue }
// Replace interfaces in proto with the actual type
let np = proto[i]
if np._tpe and np._tpe.kind == typechecking::TypeKind::STRUCTURAL {
Expand Down Expand Up @@ -7061,6 +7062,8 @@ export def create_function(
block = make_block()
}

debug::trace("Compiling function " + function.name)

function.forward_declare = false
function.allocas = vector::make(type &Insn)
let current_function = errors::current_function
Expand Down
2 changes: 2 additions & 0 deletions src/typechecking.pr
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,8 @@ export def make_struct_type(fields: &[StructMember], current_type: &Type = null)
if field.is_bitfield {
#if defined WIN32 {
// TODO Windows
bit_type = field.tpe
continue
} else {
// Linux
if not bit_type {
Expand Down

0 comments on commit b31d748

Please sign in to comment.