Skip to content

Fix `SignatureWriter` when a generic type has a depth over 30

Previously when a generic type had a depth over 30, it would not survive a round‑trip through SignatureWriter, as argumentStack would overflow into negative numbers, which the signed % and / operators would interpret incorrectly.

The solution is to use the unsigned shift and binary operators, plus an auxiliary List for when the argumentStack would overflow a 32‑bit integer.

Example

LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;LTestClose;>;

used to get malformed as:

LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric<LTestOpen;LTestGeneric;LTestClose;;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;<LTestClose;>;
Edited by ExE Boss

Merge request reports