mirror of
https://github.com/irmen/prog8.git
synced 2026-04-26 05:17:54 +00:00
fix IR codegen type error on array pointer dereference
This commit is contained in:
@@ -920,7 +920,7 @@ data class IRInstruction(
|
||||
val existingType = regsTypes[reg1]
|
||||
if (existingType!=null) {
|
||||
if (existingType != actualtype)
|
||||
throw IllegalArgumentException("register $reg1 given multiple types! $existingType and $actualtype in label ${chunk?.label} chunk $chunk")
|
||||
throw IllegalArgumentException("register $reg1 given multiple types! $existingType and $actualtype in $chunk")
|
||||
} else
|
||||
regsTypes[reg1] = actualtype
|
||||
}
|
||||
@@ -932,7 +932,7 @@ data class IRInstruction(
|
||||
val existingType = regsTypes[reg1]
|
||||
if (existingType!=null) {
|
||||
if (existingType != actualtype)
|
||||
throw IllegalArgumentException("register $reg1 given multiple types! $existingType and $actualtype in label ${chunk?.label} chunk $chunk")
|
||||
throw IllegalArgumentException("register $reg1 given multiple types! $existingType and $actualtype in chunk $chunk")
|
||||
} else
|
||||
regsTypes[reg1] = actualtype
|
||||
|
||||
@@ -946,7 +946,7 @@ data class IRInstruction(
|
||||
val existingType = regsTypes[reg1]
|
||||
if (existingType!=null) {
|
||||
if (existingType != actualtype)
|
||||
throw IllegalArgumentException("register $reg1 given multiple types! $existingType and $actualtype in label ${chunk?.label} chunk $chunk")
|
||||
throw IllegalArgumentException("register $reg1 given multiple types! $existingType and $actualtype in $chunk")
|
||||
} else
|
||||
regsTypes[reg1] = actualtype
|
||||
|
||||
@@ -962,7 +962,7 @@ data class IRInstruction(
|
||||
val existingType = regsTypes[reg2]
|
||||
if (existingType!=null) {
|
||||
if (existingType != actualtype)
|
||||
throw IllegalArgumentException("register $reg2 given multiple types! $existingType and $actualtype in label ${chunk?.label} chunk $chunk")
|
||||
throw IllegalArgumentException("register $reg2 given multiple types! $existingType and $actualtype in $chunk")
|
||||
} else
|
||||
regsTypes[reg2] = actualtype
|
||||
}
|
||||
@@ -978,7 +978,7 @@ data class IRInstruction(
|
||||
val existingType = regsTypes[reg3]
|
||||
if (existingType!=null) {
|
||||
if (existingType != actualtype)
|
||||
throw IllegalArgumentException("register $reg3 given multiple types! $existingType and $actualtype in label ${chunk?.label} chunk $chunk")
|
||||
throw IllegalArgumentException("register $reg3 given multiple types! $existingType and $actualtype in $chunk")
|
||||
} else
|
||||
regsTypes[reg3] = actualtype
|
||||
}
|
||||
@@ -1011,7 +1011,7 @@ data class IRInstruction(
|
||||
val existingType = regsTypes[it.registerNum]
|
||||
if (existingType!=null) {
|
||||
if (existingType != it.dt)
|
||||
throw IllegalArgumentException("register ${it.registerNum} given multiple types! $existingType and ${it.dt} in label ${chunk?.label} chunk $chunk")
|
||||
throw IllegalArgumentException("register ${it.registerNum} given multiple types! $existingType and ${it.dt} in $chunk")
|
||||
} else
|
||||
regsTypes[it.registerNum] = it.dt
|
||||
}
|
||||
@@ -1024,7 +1024,7 @@ data class IRInstruction(
|
||||
val existingType = regsTypes[it.reg.registerNum]
|
||||
if (existingType!=null) {
|
||||
if (existingType != it.reg.dt)
|
||||
throw IllegalArgumentException("register ${it.reg.registerNum} given multiple types! $existingType and ${it.reg.dt} in label ${chunk?.label} chunk $chunk")
|
||||
throw IllegalArgumentException("register ${it.reg.registerNum} given multiple types! $existingType and ${it.reg.dt} in $chunk")
|
||||
} else
|
||||
regsTypes[it.reg.registerNum] = it.reg.dt
|
||||
}
|
||||
|
||||
@@ -509,6 +509,8 @@ class IRCodeChunk(label: String?, next: IRCodeChunkBase?): IRCodeChunkBase(label
|
||||
}
|
||||
|
||||
val sourceLinesPositions = mutableListOf<Position>()
|
||||
|
||||
override fun toString(): String = "IRCodeChunk(label=$label, firstpos=${sourceLinesPositions.firstOrNull()})"
|
||||
}
|
||||
|
||||
class IRInlineAsmChunk(label: String?,
|
||||
|
||||
Reference in New Issue
Block a user