The following code
void main() { write("%O\n", combine_path_nt("/", "/v1/RPC")); string path = "/v1/RPC"; write("%O\n", combine_path_nt("/", path)); }
consistently give the following output on Windows Pike 8.0.182
"/v1/RPC" "//v1/v1/RPC"
but works as expected on Windows Pike 8.0.358.
Can anyone think of a fix that would make this bug go away, or is it just luck in how the compiler puts things together?
consistently give the following output on Windows Pike 8.0.182
[...]
but works as expected on Windows Pike 8.0.358.
Did you mix the numbers up? Otherwise it would seem that the issue has already been fixed?
Looks like an optimizer bug, although isn't the optimizable variant the one which gives the correct result?
I suspect that this behavior is another aspect of [bug 7723], and was fixed with commit 57ebfa38c979402b6bdca02ab6593e570d963342:
| commit 57ebfa38c979402b6bdca02ab6593e570d963342 | Author: Henrik Grubbström (Grubba) grubba@grubba.org | Date: Fri Jun 17 17:34:34 2016 +0200 | | combine_path: Survive string_builder without NUL-terminations. | | The string_builder API no longer maintains NUL-termination of the | buffer. This caused combine_path_nt() et al to fail intermittently | due to reading past the buffer end. | | Also adds a corresponding test. | | Fixes [bug 7723].
pike-devel@lists.lysator.liu.se