Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
821 stars 187 forks source link

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

Open plafosse opened 1 year ago

plafosse commented 1 year ago

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.

xusheng6 commented 1 year ago

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

emesare commented 2 weeks ago

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 commented 2 weeks ago

Blocking on: #5355