@@ -4144,16 +4144,15 @@ class TranslatedSizeofExpr extends TranslatedNonConstantExpr {
4144
4144
exists ( int n , Type dimType |
4145
4145
pointerDerefCount <= n and
4146
4146
n < vlaDimensions and
4147
- dimType = vlaDeclStmt .getTransitiveVlaDimensionStmt ( n ) .getDimensionExpr ( ) .getUnderlyingType ( )
4147
+ dimType = this .getDimensionExpr ( n ) .getUnderlyingType ( ) and
4148
+ tag = SizeofVlaConversionTag ( n )
4148
4149
|
4149
4150
(
4150
4151
expr .getUnderlyingType ( ) = dimType and
4151
- opcode instanceof Opcode:: CopyValue and
4152
- tag = SizeofVlaConversionTag ( n )
4152
+ opcode instanceof Opcode:: CopyValue
4153
4153
or
4154
4154
not expr .getUnderlyingType ( ) = dimType and
4155
- opcode instanceof Opcode:: Convert and
4156
- tag = SizeofVlaConversionTag ( n )
4155
+ opcode instanceof Opcode:: Convert
4157
4156
)
4158
4157
) and
4159
4158
resultType = this .getResultType ( )
@@ -4213,9 +4212,7 @@ class TranslatedSizeofExpr extends TranslatedNonConstantExpr {
4213
4212
tag = SizeofVlaConversionTag ( n ) and
4214
4213
(
4215
4214
operandTag instanceof UnaryOperandTag and
4216
- result =
4217
- getTranslatedExpr ( vlaDeclStmt .getTransitiveVlaDimensionStmt ( n ) .getDimensionExpr ( ) )
4218
- .getResult ( )
4215
+ result = getTranslatedExpr ( this .getDimensionExpr ( n ) ) .getResult ( )
4219
4216
)
4220
4217
)
4221
4218
or
@@ -4237,6 +4234,10 @@ class TranslatedSizeofExpr extends TranslatedNonConstantExpr {
4237
4234
)
4238
4235
}
4239
4236
4237
+ private Expr getDimensionExpr ( int n ) {
4238
+ result = vlaDeclStmt .getTransitiveVlaDimensionStmt ( n ) .getDimensionExpr ( ) .getFullyConverted ( )
4239
+ }
4240
+
4240
4241
final override Instruction getResult ( ) {
4241
4242
result = this .getInstruction ( SizeofVlaDimensionTag ( vlaDimensions - 1 ) )
4242
4243
}
0 commit comments