RFR: 8320219: Actually resolve issues with goto labels in sspi [v9]

Daniel Jeliński djelinski at openjdk.org
Mon Jan 22 14:43:29 UTC 2024


On Sun, 21 Jan 2024 07:23:37 GMT, Julian Waters <jwaters at openjdk.org> wrote:

> The previous fix was a bit too hacky for my liking, so I decided to rework it by fixing the order in which the labels are defined instead.

Please don't. #15996 was needed to keep the compiler happy, this one is not needed. Exiting a method with `goto` method and a single label at the end of the method is a popular C idiom, but adding more `goto`s and labels is just asking for trouble. If you're looking for a pure C++ solution to this problem, check out RAII / `unique_ptr`.

Note that I'm not advocating for using RAII here. The current code works and does not use any unsupported language features. If it ain't broke, don't fix it.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16682#issuecomment-1904145590



More information about the security-dev mailing list