@@ -3211,15 +3211,20 @@ bool ByteCodeExprGen<Emitter>::VisitUnaryOperator(const UnaryOperator *E) {
3211
3211
return false ;
3212
3212
if (!this ->emitAddf (getRoundingMode (E), E))
3213
3213
return false ;
3214
- return this ->emitStoreFloat (E);
3214
+ if (!this ->emitStoreFloat (E))
3215
+ return false ;
3216
+ } else {
3217
+ assert (isIntegralType (*T));
3218
+ if (!this ->emitLoad (*T, E))
3219
+ return false ;
3220
+ if (!this ->emitConst (1 , E))
3221
+ return false ;
3222
+ if (!this ->emitAdd (*T, E))
3223
+ return false ;
3224
+ if (!this ->emitStore (*T, E))
3225
+ return false ;
3215
3226
}
3216
- if (!this ->emitLoad (*T, E))
3217
- return false ;
3218
- if (!this ->emitConst (1 , E))
3219
- return false ;
3220
- if (!this ->emitAdd (*T, E))
3221
- return false ;
3222
- return this ->emitStore (*T, E);
3227
+ return E->isGLValue () || this ->emitLoadPop (*T, E);
3223
3228
}
3224
3229
case UO_PreDec: { // --x
3225
3230
if (!this ->visit (SubExpr))
@@ -3250,15 +3255,20 @@ bool ByteCodeExprGen<Emitter>::VisitUnaryOperator(const UnaryOperator *E) {
3250
3255
return false ;
3251
3256
if (!this ->emitSubf (getRoundingMode (E), E))
3252
3257
return false ;
3253
- return this ->emitStoreFloat (E);
3258
+ if (!this ->emitStoreFloat (E))
3259
+ return false ;
3260
+ } else {
3261
+ assert (isIntegralType (*T));
3262
+ if (!this ->emitLoad (*T, E))
3263
+ return false ;
3264
+ if (!this ->emitConst (1 , E))
3265
+ return false ;
3266
+ if (!this ->emitSub (*T, E))
3267
+ return false ;
3268
+ if (!this ->emitStore (*T, E))
3269
+ return false ;
3254
3270
}
3255
- if (!this ->emitLoad (*T, E))
3256
- return false ;
3257
- if (!this ->emitConst (1 , E))
3258
- return false ;
3259
- if (!this ->emitSub (*T, E))
3260
- return false ;
3261
- return this ->emitStore (*T, E);
3271
+ return E->isGLValue () || this ->emitLoadPop (*T, E);
3262
3272
}
3263
3273
case UO_LNot: // !x
3264
3274
if (DiscardResult)
0 commit comments