Nikita Popov
0f3ca15bb7
FFI: Perform bitfield operations byte-wise
...
Otherwise we may perform reads/writes outside the allocation, as
already happens in 032.phpt.
2019-06-25 14:28:58 +02:00
Nikita Popov
f127d77eef
FFI: Use signed arithmetic for pointer offset
...
offset can be negative here, using signed arithmetic avoids ubsan
warnings.
2019-06-20 16:22:26 +02:00
Dmitry Stogov
938d2359ae
Remove XFAIL mark
2019-06-17 14:56:28 +03:00
Dmitry Stogov
eda916cc98
Avoid uninitilized field access
2019-06-17 14:53:44 +03:00
Dmitry Stogov
1e0b0467b6
Fixed memory leaks in ext/ffi/tests/100.phpt on Mac OSX
2019-06-17 14:40:19 +03:00
Joe Watkins
f16b012116
fix mac tests on azure
2019-06-14 12:55:00 +02:00
Hugh McMaster
7ec50c24bb
ext/ffi: Remove symbol check for ffi_open
...
Closes GH-4215.
2019-06-03 09:19:25 +02:00
Dmitry Stogov
83804519df
Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
2019-05-28 20:10:02 +03:00
Dmitry Stogov
6738241aec
Avoid usage of internal get/set object handlers. They are going to be removed in PHP-8.
...
Scalar FFI values now should be accessed through special "cdata" property.
$x = FFI::new("int");
$x = 42;
should be changed into
$x = FFI::new("int");
$x->cdata = 42;
2019-05-28 17:08:35 +03:00
Peter Kokot
e7a1409fe1
Define minimum required libffi version
2019-05-25 08:12:15 +02:00
Dmitry Stogov
9b18afcbca
Fixed test on platforms that don't support fastcall calling convention
2019-05-14 00:21:00 +03:00
Dmitry Stogov
49de3ce3ca
Check for supported libffi ABI
2019-05-13 15:15:51 +03:00
Peter Kokot
75fb74860d
Normalize comments in *nix build system m4 files
...
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
4bfb86cdca
Remove ffi README in favour of docs
...
- https://www.php.net/manual/en/book.ffi.php
- The FFI C parser is mentioned in the CONTRIBUTING.md file
2019-05-11 14:51:14 +02:00
Peter Kokot
05350e621b
Remove example PHP script from FFI
...
FFI README.md already includes the PHP example with more information.
2019-05-08 21:55:59 +02:00
Nikita Popov
645ebcdfbf
Avoid some maybe uninitialized warnings in ffi
...
All false positives.
2019-05-07 15:44:22 +02:00
Hugh McMaster
cc9c5d8057
Use PKG_CHECK_MODULES to detect the ffi library
2019-05-07 14:28:33 +02:00
Peter Kokot
361d0b3426
Convert CRLF line endings to LF
...
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.
Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)
To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`
Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).
Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.
Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2019-05-07 04:40:01 +02:00
Peter Kokot
426bcdf021
Fix double incremenation in ffi
...
This removes the warning of:
`incremented both in the loop header and in the loop body` in the
compilation step.
2019-05-06 09:45:11 +03:00
Christoph M. Becker
30409d6753
Properly initialize variable
...
Not all code paths assign to `handle`, even though it may be used, so
we make sure that it is initialized to a sane value in the first place.
2019-05-05 17:49:54 +02:00
Christoph M. Becker
a760c79f1e
Fix typo
2019-05-05 15:40:33 +02:00
Hugh McMaster
c9ee822bb6
Always use pkg-config from the host architecture
2019-04-29 14:16:16 +02:00
Peter Kokot
1c94aac89e
[ci skip] Fix CS in Markdown files
...
Checked and quickfixed with Markdown linter
- 80 columns line width (~)
- code highlighting
- ...
Some most obvious outdated content updated a bit more.
2019-04-21 15:33:20 +02:00
Dmitry Stogov
a5e86d8264
Fixed ext/ffi/tests/044.phpt failure on 32-bit Linux
2019-04-09 16:12:13 +03:00
Anatol Belski
039500adb6
Fix handling and extend ext/ffi/tests/044.phpt
2019-03-30 12:53:32 +01:00
Dmitry Stogov
61ad294f26
Partial support for GCC mode attribute.
2019-03-29 17:28:57 +03:00
Dmitry Stogov
a2b39aa0de
Fixed memory leaks
2019-03-29 14:33:49 +03:00
Dmitry Stogov
24fa2008dd
Allow usage of incomplete types for external variables, function parameters and return values
2019-03-29 14:14:56 +03:00
Dmitry Stogov
745dd94e55
Added support for more GCC extensions: attributes, __extension__, __asm__ (ignored)
2019-03-29 02:36:55 +03:00
Dmitry Stogov
adf930c038
Ignore "__format__" attribute
2019-03-29 00:52:39 +03:00
Dmitry Stogov
94e3db64b2
Allow incomplete array variables - extern const char * const sys_errlist[]
2019-03-29 00:15:12 +03:00
Dmitry Stogov
a3e52afebe
Fixed bug #77768 (FFI: Builtin Types Should Not Raise Error On Redeclaration)
2019-03-29 00:02:26 +03:00
Dmitry Stogov
363e8dd69d
Support for __restrict and few GCC attributes
2019-03-28 03:01:20 +03:00
Dmitry Stogov
984d05f948
Use semantic predicates to simplify lookahead and reduce backtracking
2019-03-28 01:21:06 +03:00
Dmitry Stogov
164b7ec549
Regenerate parser
2019-03-25 21:45:10 +03:00
Dmitry Stogov
2ccc27bcfc
Fixed incorrect error message
2019-03-20 02:41:08 +03:00
Dmitry Stogov
defd421c0f
Improve white-space handling
2019-03-19 13:52:55 +03:00
Dmitry Stogov
c48f5fe841
Fixed ZTS cache usage
2019-03-12 12:07:25 +03:00
Dmitry Stogov
e7f0a60d54
Reset fields
2019-03-11 15:38:49 +03:00
Dmitry Stogov
e623df650f
Fixed bug #77707 (FFI loses type information for opaque types)
2019-03-11 14:26:17 +03:00
Dmitry Stogov
a1868d2291
Fixed bug #77706 (Improve error messages in FFI for incompatible arguments)
2019-03-11 13:27:23 +03:00
Peter Kokot
9df6a1e4dd
Add AS_HELP_STRING to *nix build configure options
...
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.
[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Dmitry Stogov
ff5fa0d631
Fixed support for callbacks with "void" return type
2019-03-05 01:03:47 +03:00
Dmitry Stogov
6e17fbefde
Added reference to parser generator
2019-02-20 10:26:56 +03:00
Peter Kokot
a3e3fa78f2
Fix typo
2019-02-20 09:32:42 +03:00
Peter Kokot
e765e9a8e0
Simplify even more - use PHP_VERSION directly
2019-02-20 09:32:42 +03:00
Peter Kokot
e5fe8ad6e5
Bump FFI extension version to PHP_VERSION
...
This simplifies bumping the FFI extension version.
2019-02-20 09:32:42 +03:00
Tyson Andre
cdfe11f80d
Fix ffi test on Windows
...
Fixes a bug in test added in
5661feb1ef , by checking that the
relevant SO exists.
Also adds an additional test that is based on zend_printf, and
should work on both Linux and Windows.
2019-02-19 10:03:14 +01:00
Tyson Andre
cb4c74dfe3
Fix a typo in the error messages for FFI [skip ci]
2019-02-18 17:47:41 +01:00
Dmitry Stogov
5661feb1ef
Fixed bug #77632 (FFI Segfaults When Called With Variadics)
2019-02-18 18:11:55 +03:00