@@ -274,20 +274,6 @@ void PseudoCFunction::AppendTwoOperand(const string& operand, const HighLevelILI
274
274
break ;
275
275
}
276
276
277
- if (leftExpr.operation == HLIL_SPLIT)
278
- {
279
- const auto low = leftExpr.GetLowExpr ();
280
- const auto high = leftExpr.GetHighExpr ();
281
-
282
- emitter.Append (OperationToken, " COMBINE" );
283
- emitter.AppendOpenParen ();
284
- GetExprTextInternal (high, emitter, settings);
285
- emitter.Append (TextToken, " , " );
286
- GetExprTextInternal (low, emitter, settings);
287
- emitter.AppendCloseParen ();
288
- }
289
-
290
-
291
277
if (!settings || settings->IsOptionSet (ShowTypeCasts))
292
278
{
293
279
if (leftExpr.operation == HLIL_VAR && (operand == " + " || operand == " - " ))
@@ -1511,7 +1497,8 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H
1511
1497
}
1512
1498
}
1513
1499
1514
- GetExprTextInternal (destExpr, tokens, settings, precedence);
1500
+ if (!destIsSplit)
1501
+ GetExprTextInternal (destExpr, tokens, settings, precedence);
1515
1502
if (assignUpdateOperator.has_value () && assignUpdateSource.has_value ())
1516
1503
tokens.Append (OperationToken, assignUpdateOperator.value ());
1517
1504
else
@@ -2326,7 +2313,20 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H
2326
2313
2327
2314
case HLIL_ROUND_TO_INT:
2328
2315
[&]() {
2329
- AppendTwoOperandFunction (" round" , instr, tokens, settings, false );
2316
+ auto src = instr.GetSourceExpr <HLIL_ROUND_TO_INT>();
2317
+ string round;
2318
+ if (src.size == 4 )
2319
+ round = " roundf" ;
2320
+ else if (src.size == 8 )
2321
+ round = " round" ;
2322
+ else if (src.size == 10 )
2323
+ round = " roundl" ;
2324
+ else
2325
+ round = " round" + std::to_string (src.size ) + " f" ;
2326
+ tokens.Append (OperationToken, round);
2327
+ tokens.AppendOpenParen ();
2328
+ GetExprTextInternal (src, tokens, settings);
2329
+ tokens.AppendCloseParen ();
2330
2330
if (statement)
2331
2331
tokens.AppendSemicolon ();
2332
2332
}();
@@ -2616,7 +2616,7 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H
2616
2616
bool hasOffset = offset != 0 ;
2617
2617
bool needsOuterParens = precedence > UnaryOperatorPrecedence;
2618
2618
bool showTypeCasts = !settings || settings->IsOptionSet (ShowTypeCasts);
2619
-
2619
+
2620
2620
if (needsOuterParens)
2621
2621
tokens.AppendOpenParen ();
2622
2622
@@ -2652,7 +2652,7 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H
2652
2652
}
2653
2653
else
2654
2654
{
2655
- GetExprTextInternal (srcExpr, tokens, settings,
2655
+ GetExprTextInternal (srcExpr, tokens, settings,
2656
2656
hasOffset ? AddOperatorPrecedence : UnaryOperatorPrecedence);
2657
2657
}
2658
2658
@@ -2854,7 +2854,21 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H
2854
2854
}();
2855
2855
break ;
2856
2856
2857
- case HLIL_SPLIT: break ;
2857
+ case HLIL_SPLIT:
2858
+ [&]() {
2859
+ const auto low = instr.GetLowExpr ();
2860
+ const auto high = instr.GetHighExpr ();
2861
+
2862
+ tokens.Append (OperationToken, " COMBINE" );
2863
+ tokens.AppendOpenParen ();
2864
+ GetExprTextInternal (high, tokens, settings);
2865
+ tokens.Append (TextToken, " , " );
2866
+ GetExprTextInternal (low, tokens, settings);
2867
+ tokens.AppendCloseParen ();
2868
+ if (statement)
2869
+ tokens.AppendSemicolon ();
2870
+ }();
2871
+ break ;
2858
2872
default :
2859
2873
[&]() {
2860
2874
char buf[64 ]{};
0 commit comments