binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

If the type being switched on is 'char'/'wchar' then the switch cases should be shown as char constants

Open plafosse opened this issue 3 years ago • 3 comments

Consider the following switch statement: image

In this case since the type being switched on is char we should be able to display the case labels as char as well.

plafosse avatar Oct 18 '22 15:10 plafosse

This can be handled in the very same was as we handle enum values

xusheng6 avatar Oct 19 '22 01:10 xusheng6

Propagating the type to the case expression constants is easy enough like @xusheng6 said however the char type is in fact, not a type, but the textual representation of int8_t. We can either:

  1. Just do this and be ok with non-char int8_t types having their display type changed to a constant character display type.
  2. Make a separate char type.

emesare avatar May 02 '24 20:05 emesare

Blocking on: #5355

emesare avatar May 02 '24 20:05 emesare