mirror of
https://github.com/irmen/prog8.git
synced 2025-01-14 01:29:55 +00:00
fix error when taking address of struct var
This commit is contained in:
parent
800b5b2a43
commit
1eecdd6fa3
@ -779,6 +779,9 @@ data class IdentifierReference(val nameInSource: List<String>, override val posi
|
|||||||
// if it's just a regular variable, return null.
|
// if it's just a regular variable, return null.
|
||||||
val struct = memberOfStruct(namespace) ?: return null
|
val struct = memberOfStruct(namespace) ?: return null
|
||||||
val decl = targetVarDecl(namespace)!!
|
val decl = targetVarDecl(namespace)!!
|
||||||
|
if(decl.datatype!=DataType.STRUCT)
|
||||||
|
return null
|
||||||
|
|
||||||
val firstStructMember = struct.nameOfFirstMember()
|
val firstStructMember = struct.nameOfFirstMember()
|
||||||
// find the flattened var that belongs to this first struct member
|
// find the flattened var that belongs to this first struct member
|
||||||
val firstVarName = listOf(decl.name, firstStructMember)
|
val firstVarName = listOf(decl.name, firstStructMember)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user