binutils Newspaper
NOVEMBER 30, 2026
gas — Proposed

gas: sframe: Clear caller's warning flag, not the pointer

Fixes a bug in sframe where a caller's warning flag was not being cleared due to incorrect pointer handling.

This patch corrects a bug in the sframe functionality within gas where the sframe_xlate_do_escape_cfa_expr function incorrectly handled its caller_warn_p parameter. Instead of dereferencing the pointer to set the caller’s warning flag to false, it assigned false to the local pointer variable itself. This meant the caller’s flag remained unchanged (and effectively true, due to initialization), potentially leading to incorrect behavior. The fix ensures the flag is correctly cleared.

In the Thread 1 participant
  1. Pietro Monteiro <pietro@sociotechnical.xyz> proposer

    Submits a patch to fix a bug in `gas`'s sframe handling where a caller's warning flag was not being cleared due to incorrect pointer manipulation.

    “sframe_xlate_do_escape_cfa_expr set its caller_warn_p parameter to false instead of storing false through it, so the local pointer was nulled and the caller's flag left untouched. This was harmless only because the caller initializes the flag to false.”

In Details

This patch addresses an issue in gas/gen-sframe.c related to the sframe_xlate_do_escape_cfa_expr function. The function receives caller_warn_p as a pointer to a boolean flag. The bug was that instead of writing false to the location pointed to by caller_warn_p (i.e., *caller_warn_p = false;), it assigned false to the pointer variable itself (caller_warn_p = false;). This nullified the pointer, leaving the original flag untouched. The fix involves changing the assignment to the correct dereferenced form. This was discovered during an autoconf 2.73 upgrade and GCC 14.2 build, po…

For Context
gas
The GNU Assembler, part of the GNU Compiler Collection (GCC).
sframe
A library for handling stack frame records, often used in debugging and profiling tools. In this context, it's used by the assembler.
CFA
Canonical Frame Address. A value that represents the base of the current stack frame.
pointer
A variable that stores the memory address of another variable.
dereference
Accessing the value stored at the memory address pointed to by a pointer.
Filed Under: gassframebug fixpointer