| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix an alignment build warning/error in function ``PyVectorcall_Function()`` publicly exposed by ``abstract.h``. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -205,6 +205,10 @@ PyObject * | |
| PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *kwargs) | ||
| { | ||
| PyThreadState *tstate = _PyThreadState_GET(); | ||
| union { | ||
| char *data; | ||
| vectorcallfunc *ptr; | ||
| } vc; | ||
|
|
||
| /* get vectorcallfunc as in PyVectorcall_Function, but without | ||
| * the Py_TPFLAGS_HAVE_VECTORCALL check */ | ||
| Expand All | @@ -215,7 +219,8 @@ PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *kwargs) | |
| Py_TYPE(callable)->tp_name); | ||
| return NULL; | ||
| } | ||
| vectorcallfunc func = *(vectorcallfunc *)(((char *)callable) + offset); | ||
| vc.data = (char *)callable + offset; | ||
| vectorcallfunc func = *vc.ptr; | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualitySame comment here.
Sorry, something went wrong.
All reactions
|
||
| if (func == NULL) { | ||
| _PyErr_Format(tstate, PyExc_TypeError, | ||
| "'%.200s' object does not support vectorcall", | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI don't think this is better. The correct, idiomatic solution is something like:
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality(also, note that any decent compiler will optimize the memcpy call away)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.