Skip to content

Commit

Permalink
fixed segmentation fault for zero length files (#428)
Browse files Browse the repository at this point in the history
* fixed segmentation fault for zero length files
* fixed codeclimate reporter on C++ target
  • Loading branch information
AlexHaxe authored Jun 1, 2018
1 parent bbcdff7 commit 25e5d19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- Fixed detection of absolute paths when using `extendsConfigPath` [#422](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/422)
- Fixed reported position of Indentation check [#421](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/421)
- Fixed Haxe 4 compilation and reenabled Travis CI development build [#423](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/423) + [#425](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/425)
- Fixed Codeclimate reporter output for C++ target [#428](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/428)
- Fixed segmentation fault when checking zero length files [#428](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/428)
- Improved if / else detection of RightCurly check [#421](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/421)
- Improved support for eval target and Haxe 4 [#423](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/423)
- Refactored configuration parser [#420](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/420)
Expand Down
1 change: 1 addition & 0 deletions src/checkstyle/checks/Check.hx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Check {
}

function isLineSuppressed(i:Int):Bool {
if (checker.linesIdx.length <= i) return false;
return isCharPosSuppressed(checker.linesIdx[i].l);
}

Expand Down
3 changes: 2 additions & 1 deletion src/checkstyle/reporter/CodeClimateReporter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class CodeClimateReporter extends BaseReporter {
}
};

Sys.print(Json.stringify(issue) + "\u0000");
Sys.print(Json.stringify(issue));
Sys.stdout().writeByte(0);
}

function getSeverity(severity:SeverityLevel):String {
Expand Down

0 comments on commit 25e5d19

Please sign in to comment.