Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.cbm
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ TEST_REPRO_SRCS = \
tests/repro/repro_issue363.c \
tests/repro/repro_issue581.c \
tests/repro/repro_issue787.c \
tests/repro/repro_issue842.c \
tests/repro/repro_invariant_calls.c \
tests/repro/repro_invariant_graph.c \
tests/repro/repro_invariant_breadth.c \
Expand Down
6 changes: 6 additions & 0 deletions src/pipeline/pass_definitions.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@ static int create_env_configures_for_file(cbm_pipeline_ctx_t *ctx, const CBMFile
const cbm_gbuf_node_t *src = NULL;
if (ea->enclosing_func_qn && ea->enclosing_func_qn[0]) {
src = cbm_gbuf_find_by_qn(ctx->gbuf, ea->enclosing_func_qn);
/* A class-level env access in a directory-module language carries
* the DIRECTORY module QN, which hits the shared Folder/Project
* node — attribute to this file's File node instead (#787, #842). */
if (cbm_pipeline_node_is_dir_container(src)) {
src = NULL;
}
}
if (!src) {
if (!file_qn) {
Expand Down
12 changes: 8 additions & 4 deletions src/pipeline/pass_parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2392,14 +2392,18 @@ static void resolve_file_usages(resolve_ctx_t *rc, resolve_worker_state_t *ws,

/* Resolve throws/raises for one file. */
static void resolve_file_throws(resolve_ctx_t *rc, resolve_worker_state_t *ws,
CBMFileResult *result, const char *module_qn, const char **imp_keys,
const char **imp_vals, int imp_count) {
CBMFileResult *result, const char *rel, const char *module_qn,
const char **imp_keys, const char **imp_vals, int imp_count) {
for (int t = 0; t < result->throws.count; t++) {
CBMThrow *thr = &result->throws.items[t];
if (!thr->exception_name || !thr->enclosing_func_qn) {
continue;
}
const cbm_gbuf_node_t *src = cbm_gbuf_find_by_qn(rc->main_gbuf, thr->enclosing_func_qn);
/* find_source_node falls back to the per-file File node when the
* lookup lands on a shared Folder/Project node (#787, #842) — same
* guard resolve_file_calls/usages/rw already use. */
const cbm_gbuf_node_t *src =
find_source_node(rc->main_gbuf, rc->project_name, rel, thr->enclosing_func_qn);
if (!src) {
continue;
}
Expand Down Expand Up @@ -2808,7 +2812,7 @@ static void resolve_worker(int worker_id, void *ctx_ptr) {

/* ── THROWS / RAISES ───────────────────────────────────── */
_ph_t0 = extract_now_ns();
resolve_file_throws(rc, ws, result, module_qn, imp_keys, imp_vals, imp_count);
resolve_file_throws(rc, ws, result, rel, module_qn, imp_keys, imp_vals, imp_count);
atomic_fetch_add_explicit(&rc->time_ns_throws, extract_now_ns() - _ph_t0,
memory_order_relaxed);

Expand Down
Loading
Loading