chore: compiler memory safety, perf, and CodeQL cleanup#1610
Merged
Conversation
| size_t klen = (size_t)(colon - start); | ||
| char *key = malloc(klen + 1); | ||
| if (!key) return &TYPE_UNKNOWN; | ||
| char *key = xmalloc(klen + 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ns_name,mangled,rn,check_name/prefix)util/xalloc.h(xmalloc/xcalloc/xrealloc) — abort-on-OOM helpers matching the inline pattern already inbuf.c/arena.cmalloc/calloc/realloccalls incodegen.c,typechecker.c,types.c,scope.c,error.cthrough the xalloc helpersPerformance
error_codes.c: chainedstrcmplookup → sortedbsearchtypechecker/types.c::type_from_name: ~25 chainedstrcmps → static sorted bsearch table dispatching singletons + sized variants in one shotcodegen.c: replacedO(struct_count × field_count)scan in the member-call fallback heuristic with a lazily-built(field_name, struct_name)index over only func-typed fieldscodegen.c::find_func: linear scan → separate sorted view (funcs_by_name) + bsearch.cg->all_funcskeeps insertion order so emission and prefix-match scansstreamarg in non-container char print (emitfhad 2%sand 3 args)heap-allocated
mangledbuffer in monomorphisation forward-decl loop instead of letting a stack address briefly live in the ASTreplaced two duplicated case-insensitive
true/falseparsers withstrncasecmp-
io.copy_filenow creates the destination with mode 0644 viaopen()+fdopen()instead offopen()'s 0666-mod-umask default—
ez_arrays.remove_floatneeds bit-equal lookup;fmt_shortest_floatis the canonical round-trip-precision idiom