Merge pull request #6047 from jepler/fix-qstr-error

Fix qstr error
This commit is contained in:
Dan Halbert 2022-02-17 13:21:12 -05:00 committed by GitHub
commit 16c44a4d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -48,6 +48,7 @@ def preprocess(command, output_dir, fn):
process_file(fn, output_dir, output)
except Exception as e:
print(e, file=sys.stderr)
raise
def maybe_preprocess(command, output_dir, fn):
@ -72,6 +73,18 @@ if __name__ == "__main__":
# Mac and Windows use 'spawn'. Uncomment this during testing to catch spawn-specific problems on Linux.
# multiprocessing.set_start_method("spawn")
executor = ProcessPoolExecutor(max_workers=multiprocessing.cpu_count() + 1)
executor.map(maybe_preprocess, itertools.repeat(command), itertools.repeat(output_dir), check)
executor.map(preprocess, itertools.repeat(command), itertools.repeat(output_dir), always)
results = []
try:
results.extend(
executor.map(
maybe_preprocess, itertools.repeat(command), itertools.repeat(output_dir), check
)
)
results.extend(
executor.map(
preprocess, itertools.repeat(command), itertools.repeat(output_dir), always
)
)
except subprocess.CalledProcessError:
raise SystemExit(1)
executor.shutdown()

View File

@ -87,11 +87,13 @@ STATIC int put_utf8(char *buf, int u) {
}
uint16_t decompress_length(const compressed_string_t *compressed) {
#ifndef NO_QSTR
#if (compress_max_length_bits <= 8)
return 1 + (compressed->data >> (8 - compress_max_length_bits));
#else
return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits));
#endif
#endif
}
char *decompress(const compressed_string_t *compressed, char *decompressed) {