Replies: 1 comment 1 reply
-
Honestly, your 'mul' approach in the Tricore module makes code unreadable in a many cases. It's a good fit, if condition can be evaluted as a constant, otherwise Ghidra often uses long expression for it, making a lot of mess. Back to the topic. I agree, it will make life easier, especially if such operator can be used both with const and non-const conditions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://en.wikipedia.org/wiki/Ternary_conditional_operator
Currently SLEIGH, to avoid a
goto
, uses a choosing operation with boolean expression multiplication where only once boolean expression is true. Complicated verbose SLEIGH implementations using the boolean multiplication vs agoto
which would more likely insertif/else
logic where, depending, theif
may be hardcoded to be false.Various implementations of this setup exist, with some modules consistent with others, across all instructions, mixed goto/boolean multiplication, and some choose to use the
goto
approach entirely.Could SLEIGH get an official ternary operator added to the language.. PCODE could possibly be tailored better to this setup in the compiler and would be consistent allowing analysis tooling to provide improved results.
variable = <condition> ? <expression_true> : <expression_false>
Beta Was this translation helpful? Give feedback.
All reactions