Skip to content

Conversation

@larskanis
Copy link
Collaborator

@larskanis larskanis commented Apr 27, 2023

Initialize connection and typemap prior to any object allocations, to make sure valid objects are marked.

This regression was introduced in commit 5061020 while introducing write barriers. However it is not necessary to use RB_OBJ_WRITE when the "old" object (1st argument) is not yet created or immediately after it was created. The initial assignment can and must be done before processing the typemap as it was before the above commit.

Fixes #530

Initialize connection and typemap prior to any object allocations, to make sure valid objects are marked.

This regression was introduced in commit 5061020 while introducing write barriers.
However it is not necessary to use RB_OBJ_WRITE when the "old" object (1st argument) is not yet created or immediately after it was created.
The initial assignment can and must be done before processing the typemap as it was before the above commit.

Fixes ged#530
A C macro might execute the parameter twice, so that fit_to_result() would be called twice.
Although this is just hypotetical, storing in a local variable ensures calling twice will not happen.
@larskanis larskanis merged commit 4764bc4 into ged:master Apr 28, 2023
@larskanis larskanis deleted the fix-530 branch April 28, 2023 11:55
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.

Seg fault after upgrading to pg v1.5.2

1 participant