In this function, openTokenStack is not aliased to as an array like it is in parse(). Therefore, if there's an openTokenDepth of 2 for example, it actually writes it at memory offset 2 from the address of openTokenStack rather than 2 * sizeof(OpenToken).
I don't know whether this actually causes any issues for end users.
I came across this potential issue when repurposing this module for my own nefarious purposes.
https://github.com/guybedford/es-module-lexer/blob/605184a98713afdd6f3a16d5004c6a9fec136f5f/src/lexer.c#L717-L722
In this function, openTokenStack is not aliased to as an array like it is in
parse()
. Therefore, if there's an openTokenDepth of 2 for example, it actually writes it at memory offset 2 from the address ofopenTokenStack
rather than2 * sizeof(OpenToken)
.I don't know whether this actually causes any issues for end users.