John Brandwood - 2024-03-24

This actually turned out to be nothing to do with a heap-use-after-free when debugging!

It is caused by get_repl() corrupting the invocation of the 9th or 32nd macro
parameter when it is used at the end of the replacement text, because it sees
the encoded 0x09 or 0x20 formal parameter index as a trailing space to delete.

That corruption then goes on to cause the undefined behavior which results in
a segfault.

I've checked-in a fix for this here ...

https://github.com/jbrandwood/mcpp/commit/f1e1c717840b4a18446d1f26de4f72ebdd105650

 

Last edit: John Brandwood 2024-03-24