GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix a compiler warning in _xxsubinterpretermodule.c by Yhg1s · Pull Request #103245 · python/cpython

Conversation

@Yhg1s

@Yhg1s Yhg1s commented Apr 4, 2023

Copy link
Copy Markdown
Member

Fix a (correct) warning about potential uses of uninitialized memory in _xxsubinterpreter. Unlike newly allocated PyObject structs or global structs, stack-allocated structs are not initialised, and a few places in the code expect the _sharedexception struct data to be NULL when not set.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Yhg1s
Fix a (correct) warning about potential uses of uninitialized memory in
4db1ecd
_xxsubinterpreter. Unlike newly allocated PyObject structs or global
structs, stack-allocated structs are not initialised, and a few places in
the code expect the _sharedexception struct data to be either NULL or
initialised.
@Yhg1s Yhg1s added skip issue skip news labels Apr 4, 2023
@Yhg1s
Yhg1s requested a review from ericsnowcurrently April 4, 2023 11:13
@bedevere-bot bedevere-bot added the awaiting core review label Apr 4, 2023
erlend-aasland
erlend-aasland approved these changes Apr 4, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Apr 4, 2023
ericsnowcurrently
ericsnowcurrently approved these changes Apr 4, 2023
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Yhg1s
Yhg1s merged commit 89e6a34 into python:main Apr 4, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Apr 4, 2023
@Yhg1s
Yhg1s deleted the xxsubinterp-warning branch April 4, 2023 14:53
@gaogaotiantian gaogaotiantian mentioned this pull request Apr 4, 2023
gh-101659: initialize stack variable _sharedexception #103048
Closed
@gaogaotiantian

gaogaotiantian commented Apr 4, 2023

Copy link
Copy Markdown
Member

In my opinion, the fix in #103048 is slightly better. Function wise they are equivalent as of now, but no_exception has better semantics. Also, in the future if struct _sharedexception is changed(this is a local use data structure), one less line of code to worry about. If we only want to zero initialize the struct, _sharedexception exc = {0}; can also save the trouble to modify it in the future in case the struct is changed.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gaogaotiantian pushed a commit to gaogaotiantian/cpython that referenced this pull request Apr 8, 2023
@Yhg1s @gaogaotiantian
Fix a compiler warning in _xxsubinterpretermodule.c (python#103245)
8c18f46
Fix a (correct) warning about potential uses of uninitialized memory in
_xxsubinterpreter. Unlike newly allocated PyObject structs or global
structs, stack-allocated structs are not initialised, and a few places in
the code expect the _sharedexception struct data to be either NULL or
initialised.
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@Yhg1s @warsaw
Fix a compiler warning in _xxsubinterpretermodule.c (python#103245)
247b336
Fix a (correct) warning about potential uses of uninitialized memory in
_xxsubinterpreter. Unlike newly allocated PyObject structs or global
structs, stack-allocated structs are not initialised, and a few places in
the code expect the _sharedexception struct data to be either NULL or
initialised.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently ericsnowcurrently approved these changes
@erlend-aasland erlend-aasland erlend-aasland approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@Yhg1s @gaogaotiantian @ericsnowcurrently @erlend-aasland @bedevere-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.