Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2a8ef680
Commit
2a8ef680
authored
Dec 17, 2014
by
Steve Dower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22733: MSVC ffi_prep_args doesn't handle 64-bit arguments properly
parent
64c89140
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
Modules/_ctypes/libffi_msvc/ffi.c
Modules/_ctypes/libffi_msvc/ffi.c
+28
-9
No files found.
Modules/_ctypes/libffi_msvc/ffi.c
View file @
2a8ef680
...
...
@@ -65,37 +65,56 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
argp
=
(
char
*
)
ALIGN
(
argp
,
sizeof
(
void
*
));
z
=
(
*
p_arg
)
->
size
;
if
(
z
<
sizeof
(
int
))
if
(
z
<
sizeof
(
int
ptr_t
))
{
z
=
sizeof
(
int
);
z
=
sizeof
(
int
ptr_t
);
switch
((
*
p_arg
)
->
type
)
{
case
FFI_TYPE_SINT8
:
*
(
signed
int
*
)
argp
=
(
signed
in
t
)
*
(
SINT8
*
)(
*
p_argv
);
*
(
intptr_t
*
)
argp
=
(
intptr_
t
)
*
(
SINT8
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_UINT8
:
*
(
u
nsigned
int
*
)
argp
=
(
unsigned
in
t
)
*
(
UINT8
*
)(
*
p_argv
);
*
(
u
intptr_t
*
)
argp
=
(
uintptr_
t
)
*
(
UINT8
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_SINT16
:
*
(
signed
int
*
)
argp
=
(
signed
in
t
)
*
(
SINT16
*
)(
*
p_argv
);
*
(
intptr_t
*
)
argp
=
(
intptr_
t
)
*
(
SINT16
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_UINT16
:
*
(
u
nsigned
int
*
)
argp
=
(
unsigned
in
t
)
*
(
UINT16
*
)(
*
p_argv
);
*
(
u
intptr_t
*
)
argp
=
(
uintptr_
t
)
*
(
UINT16
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_SINT32
:
*
(
signed
int
*
)
argp
=
(
signed
in
t
)
*
(
SINT32
*
)(
*
p_argv
);
*
(
intptr_t
*
)
argp
=
(
intptr_
t
)
*
(
SINT32
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_UINT32
:
*
(
unsigned
int
*
)
argp
=
(
unsigned
int
)
*
(
UINT32
*
)(
*
p_argv
);
*
(
uintptr_t
*
)
argp
=
(
uintptr_t
)
*
(
UINT32
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_FLOAT
:
*
(
uintptr_t
*
)
argp
=
0
;
*
(
float
*
)
argp
=
*
(
float
*
)(
*
p_argv
);
break
;
// 64-bit value cases should never be used for x86 and AMD64 builds
case
FFI_TYPE_SINT64
:
*
(
intptr_t
*
)
argp
=
(
intptr_t
)
*
(
SINT64
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_UINT64
:
*
(
uintptr_t
*
)
argp
=
(
uintptr_t
)
*
(
UINT64
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_STRUCT
:
*
(
unsigned
int
*
)
argp
=
(
unsigned
int
)
*
(
UINT32
*
)(
*
p_argv
);
*
(
uintptr_t
*
)
argp
=
(
uintptr_t
)
*
(
UINT32
*
)(
*
p_argv
);
break
;
case
FFI_TYPE_DOUBLE
:
*
(
uintptr_t
*
)
argp
=
0
;
*
(
double
*
)
argp
=
*
(
double
*
)(
*
p_argv
);
break
;
default:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment