Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #12291: fix bound condition in EmptyForInitializerPadCheck #12310

Merged
merged 1 commit into from Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -152,7 +152,7 @@ public void visitToken(DetailAST ast) {
final int[] line = getLineCodePoints(lineIdx);
final int before = ast.getColumnNo() - 1;
// don't check if semi at beginning of line
if (!CodePointUtil.hasWhitespaceBefore(before, line)) {
if (ast.getColumnNo() > 0 && !CodePointUtil.hasWhitespaceBefore(before, line)) {
romani marked this conversation as resolved.
Show resolved Hide resolved
if (option == PadOption.NOSPACE
&& CommonUtil.isCodePointWhitespace(line, before)) {
log(ast, MSG_PRECEDED, SEMICOLON);
Expand Down
Expand Up @@ -58,4 +58,9 @@ void method2()
;; ) {
}
}

void method3() {
for (
;;) {}
}
}