On Tue, 5 Dec 2023 15:07:15 GMT, Weijun Wang <wei...@openjdk.org> wrote:
> I still don't like this solution: > > 1. Duplicated lines. > 2. There are other `goto`s in this file. I know they happen to be unaffected, > but if `goto` is not recommended in C++ it looks unfair to remove some and > keep some. > > Can we throw and catch exceptions? Or, how difficult is it to rewrite to > simply C? Just substitute `new` and `delete` with `malloc` and `free`? I'm afraid the same is also strictly an error in C as well, though the compiler sometimes doesn't error on these constructs (non-conforming behaviour). I can see how the solution leaves a lot to be desired, I wonder if I could move the gotos to a common place where they don't intersect local definitions instead? As for exceptions, I don't know if it can be done, since the existing code seems to suggest that they are not desired ------------- PR Comment: https://git.openjdk.org/jdk/pull/16682#issuecomment-1850028813