Repository navigation
Conversation
added 3 commits
September 30, 2026 12:23
The Linux runtimes carried Darwin's signal layouts. posix_run_argv kept the old signal mask in a u32 while glibc's sigprocmask writes all 128 bytes of sigset_t: the write ran over posix_run_argv's frame and replaced the saved cwd pointer, so every child of with_exec_argv_capture_cwd failed chdir (EFAULT, exit 127). gdb on behav_migrate_assert_macro's kept binary: posix_run_argv saves cwd at 0x10(%rsp), prev_mask lives at 0xc(%rsp), and the child called chdir(0x7df400000000). Also Darwin's: SIG_BLOCK/SIG_SETMASK are 0/2 on Linux (1 was SIG_UNBLOCK, 3 EINVAL), struct sigaction is 152 bytes (sigaction read 136 bytes past a 16-byte buffer for sa_mask and sa_flags), and RLIM_INFINITY is ~0.
…arded effects are never dropped (#1911) glibc's <limits.h> defines ULLONG_MAX as (LLONG_MAX * 2ULL + 1). The translator rendered it LLONG_MAX * 2u64: i64 arithmetic by With's rules, so __with_init_const_ULLONG_MAX called llvm.smul.with.overflow.i64( 9223372036854775807, 2) and every program importing it (zlib, libcurl facades) panicked "i64 multiplication out of range" at start (9ee1234); after §4.2.6 the same text is a refused sign change. ci_c_binary now types each operand (suffixed literal, cast, emitted macro constant, translated operator) and spells C's common type when signedness differs; a function-like macro returns that type, and a comparison-valued one returns c_int (it was `-> i32` over a bool). glibc's assert is ((void) sizeof ((e) ? 1 : 0), __extension__ ({ if (e) ; else __assert_fail (...); })). lower_effect_expr_ir merged the comma's failed right operand (0) as an empty one, so a failed assert ran on (behav_migrate_assert_macro line 19). A failed operand now fails the comma; __extension__ is transparent (the bridge maps CXUnaryOperator_Extension); a discarded statement expression lowers as its statements; a discarded operator keeps its operands' side effects.
…never peeled; discarded arms keep their effects; hygienic helper names (#1933) An UnexposedExpr with several expression operands is not a wrapper, but every lowering peeled it to its last child: `__builtin_choose_expr(1, f(), 7)` returned 7, `f() ?: 1` returned 1 without calling f, and `__atomic_load_n(&g, 0)` returned its memory order, 0. ci_unexposed_expr_form names the forms: choose_expr (spelled in the source) lowers its selected operand, `a ?: b` (libclang visits the common operand, its two opaque uses as that same cursor, then the fallback) lowers through a temporary evaluated once, and anything else fails the function with "C expression `...` has no translation". lower_discard_expr_side_effects_ir ended by turning a failed value lowering into an empty statement and dropping effects inside a valid one: `c ? arr[f() & 3] : 0` lost the call, and a refused union initializer in that arm passed with its bail recorded and ignored. The tail is now the expression statement lower_effect_expr_ir makes (zero on failure). The migrator's helpers share a module with the C program's globals, so a global named a, b, c, out or result made each helper parameter a refused shadow. Helper parameters and locals take the __with_ prefix.
Contributor
Author
|
Battery GREEN on stack top 3743c81 (seed-driven, |
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.
Fixes #1911 (root causes found with gdb on eric-5090):
Tests red → green: behav_c_import_macro_usual_conversions, behav_migrate_discarded_effects; the four facade tests and behav_migrate_assert_macro green on Linux. Mac :gate green. Draft: #1933 fixes and the Linux zero-dependency work (#1915) land on this branch / above it next; one battery for the batch.