Skip to content

Initialise TempFileData and return HspContext members by reference - #982

Merged
bbuchfink merged 1 commit into
bbuchfink:masterfrom
kevinmoran1988:pr/tempfile-init-hspcontext-ref
Sep 24, 2026
Merged

bbuchfink merged 1 commit into
bbuchfink:masterfrom
kevinmoran1988:pr/tempfile-init-hspcontext-ref

Conversation

@kevinmoran1988

Copy link
Copy Markdown
Contributor

TempFileData::fd was left uninitialised on the _MSC_VER branch of
open_tmp_file, which returns before assigning it. The struct is now
default-initialised (fd = -1, unlinked = false). The MSVC path opens by name
rather than by descriptor, so the value was never read.

HspContext::transcript() and hsp() returned by value, copying the transcript
vector and the whole Hsp on every call. Both now return a const reference; the
one caller in daa_record.cpp still copies, once.

Builds on v2.2.8 (745cd3b) and passes ctest.

An AI assistant (Claude Code Opus 5.0) assisted with this work.

…rence

TempFileData::fd was left uninitialised on the _MSC_VER branch of
open_tmp_file, which returns before assigning it. Default-initialise the
struct. The MSVC path opens by name rather than by descriptor, so the
value was never dereferenced.

HspContext::transcript() and hsp() returned by value, copying the
transcript vector and the whole Hsp on every call. Both now return a
const reference; the one caller in daa_record.cpp still copies, once.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bbuchfink
bbuchfink merged commit 8d62c49 into bbuchfink:master Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants