Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jaitjacob committed Feb 26, 2024
2 parents a6f3d35 + 16b2fe1 commit c1fc9a4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
13 changes: 12 additions & 1 deletion dist/arch/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,21 @@ cd "$(dirname "${0}")"
errors="$(mktemp)"
trap 'rm -f "${errors}"' EXIT

# HACK(strager): Disable the symlink check. The debug package
# references files in the main package
# (usr/lib/debug/.build-id/7d/de35aceb40462c945841b0d88b87fdfab87ea5
# points to ../../../../bin/quick-lint-js), but because namcap lints
# each package separately, namcap doesn't see the file from the main
# package when linting the debug package.
#
# HACK(strager): Disable the emptydir check. The debug package,
# created automatically with OPTIONS=(debug strip), has an empty
# directory (usr/src/debug/quick-lint-js-dev/quick-lint-js/build).
#
# HACK(strager): Disable the unusedsodepends check. With -Wl,--gc-sections, the
# check fails on libm. Even with -Wl,--as-needed, the linker keeps the NEEDED
# entry, so I don't know how to work around the libm dependency.
namcap --exclude=unusedsodepends PKGBUILD-dev PKGBUILD-git PKGBUILD-release ./quick-lint-js-*.pkg.tar.zst |& tee "${errors}"
namcap --exclude=emptydir,symlink,unusedsodepends PKGBUILD-dev PKGBUILD-git PKGBUILD-release ./quick-lint-js-*.pkg.tar.zst |& tee "${errors}"
if [ -s "${errors}" ]; then
printf 'error: namcap reported an error\n' >&2
exit 1
Expand Down
10 changes: 10 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Semantic Versioning.

* TypeScript: `(): RT<T>=>null` (with no spaces in `>=>`) now parses correctly.
(Fixed by [vegerot][].)
* Fixed [E0718][] falsely diagnosing valid code. ([#1192][], [#1199][])
* quick-lint-js no longer crashes in the presence of symbolic links and
directory junctions on Windows. ([#1182][])
* Fixed a read buffer overflow (possibly leading to a crash) when checking
whether short identifiers containing Unicode escape sequences are keywords.
(x86 and x86_64 only.) ([#1191][])

## 3.1.0 (2024-01-10)

Expand Down Expand Up @@ -1416,7 +1422,11 @@ Beta release.
[#1168]: https://github.com/quick-lint/quick-lint-js/pull/1168
[#1171]: https://github.com/quick-lint/quick-lint-js/issues/1171
[#1180]: https://github.com/quick-lint/quick-lint-js/issues/1180
[#1182]: https://github.com/quick-lint/quick-lint-js/issues/1182
[#1191]: https://github.com/quick-lint/quick-lint-js/issues/1191
[#1192]: https://github.com/quick-lint/quick-lint-js/issues/1192
[#1194]: https://github.com/quick-lint/quick-lint-js/issues/1194
[#1199]: https://github.com/quick-lint/quick-lint-js/issues/1199

[E0001]: https://quick-lint-js.com/errors/E0001/
[E0003]: https://quick-lint-js.com/errors/E0003/
Expand Down
9 changes: 8 additions & 1 deletion src/quick-lint-js/fe/lex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <quick-lint-js/diag/buffering-diag-reporter.h>
#include <quick-lint-js/diag/diag-list.h>
#include <quick-lint-js/diag/diagnostic-types.h>
#include <quick-lint-js/fe/keyword-lexer.h>
#include <quick-lint-js/fe/lex.h>
#include <quick-lint-js/fe/token.h>
#include <quick-lint-js/port/bit.h>
Expand Down Expand Up @@ -1832,9 +1833,15 @@ Lexer::Parsed_Identifier Lexer::parse_identifier_slow(
}
}

String8_View normalized_view = normalized.release_to_string_view();

// Add padding bytes required by Keyword_Lexer. This should not be considered
// part of the returned string.
normalized.resize(normalized.size() + Keyword_Lexer::padding_size);

return Parsed_Identifier{
.after = input,
.normalized = normalized.release_to_string_view(),
.normalized = normalized_view,
.escape_sequences = escape_sequences,
};
}
Expand Down

0 comments on commit c1fc9a4

Please sign in to comment.