Similar to #3388, if fixing multiple expressions in the same line, the autofixes can get mixed up and duplicated, resulting in garbled code.
Here is the repro: https://semgrep.dev/s/gordonwoodhull:wrap-strings
On semgrep.dev it produces the correct individual suggestions. However, when running semgrep 0.59 on the command line with --autofix, it looks like it confuses the output positions between the two fixes.
The rule attempts to replace the expression pattern (String $S) with the fix wrap($S).
On input
it produces the output
return wrap("wrap("b") + "b";
Similar to #3388, if fixing multiple expressions in the same line, the autofixes can get mixed up and duplicated, resulting in garbled code.
Here is the repro: https://semgrep.dev/s/gordonwoodhull:wrap-strings
On semgrep.dev it produces the correct individual suggestions. However, when running semgrep 0.59 on the command line with
--autofix, it looks like it confuses the output positions between the two fixes.The rule attempts to replace the expression pattern
(String $S)with the fixwrap($S).On input
it produces the output