Skip to content

Commit

Permalink
use proper sizes for pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Glowman554 committed May 29, 2024
1 parent 0ec4614 commit 5c74353
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fire/firestorm/target/llvm/llvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,20 @@ func (b *LLVM) datatypeToLLVM(d parser.UnnamedDatatype) types.Type {

func (b *LLVM) datatypeToSize(d parser.UnnamedDatatype) int {
if d.IsArray {
return 8
return int(b.ptrType.(*types.IntType).BitSize)
}

switch d.Type {
case parser.INT:
return 8
case parser.STR:
return 8
return int(b.ptrType.(*types.IntType).BitSize)
case parser.VOID:
return 0
case parser.CHR:
return 1
case parser.PTR:
return 8
return int(b.ptrType.(*types.IntType).BitSize)
case parser.INT_32:
return 4
case parser.INT_16:
Expand Down

0 comments on commit 5c74353

Please sign in to comment.