mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
5e7834aa2e
bump() has a safety invariant that there must be input in the buffer to read (See https://github.com/swc-project/swc/issues/7709). This function as currently written calls `bump()` after calling `read_token_interpreter()`, which *may* have exhausted the buffer already in the specific case that it is handling a shebang. (The input string `#!/bin/js` with no newline is sufficient to cause UB here) Fortunately, shebangs never reach this function, due to `read_shebang`! Hurray! It's cleaner to not attempt to handle shebangs here when this code path will never be reached, and use a debug assertion to ensure that we're not dealing with shebangs. |
||
---|---|---|
.. | ||
benches | ||
examples | ||
scripts | ||
src | ||
tests | ||
.gitignore | ||
Cargo.toml | ||
colors.js |