Skip to content

Instantly share code, notes, and snippets.

View nielsdos's full-sized avatar

Niels Dossche nielsdos

  • Belgium
View GitHub Profile
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 238212c745..e9b5152f97 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -46,7 +46,11 @@ typedef struct {
FILE *fopencookie(void *cookie, const char *mode, cookie_io_functions_t *funcs)
{
- return funopen(cookie, funcs->reader, funcs->writer, funcs->seeker, funcs->closer);
+ FILE *file = funopen(cookie, funcs->reader, funcs->writer, funcs->seeker, funcs->closer);
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 238212c745..b93db2f6d3 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -61,8 +61,12 @@ FILE *fopencookie(void *cookie, const char *mode, cookie_io_functions_t *funcs)
static int stream_cookie_reader(void *cookie, char *buffer, int size)
{
int ret;
-
- ret = php_stream_read((php_stream*)cookie, buffer, size);
--TEST--
Test CURL_READFUNC_PAUSE and curl_pause()
--EXTENSIONS--
curl
--FILE--
<?php
include 'server.inc';
$host = curl_cli_server_start();
class CrashingFifo {
diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c
index 7ba9abd193..c779f0351e 100644
--- a/ext/zend_test/test.c
+++ b/ext/zend_test/test.c
@@ -1057,26 +1057,14 @@ static ZEND_METHOD(_ZendTestClass, returnByRefIntProp)
ZEND_ASSERT(int_prop);
ZEND_ASSERT(!Z_ISERROR_P(int_prop));
- /* Copied from zend_assign_to_variable_reference() */
- zend_reference *ref;
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 838a237ca8..9987f871a7 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -564,18 +564,23 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock
memset(unix_addr, 0, sizeof(*unix_addr));
unix_addr->sun_family = AF_UNIX;
+ /* Abstract namespace does not need to be NUL-terminated, while path-based
+ * sockets should be. */
diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c
index 560338e71f3..8b0b58105d3 100644
--- a/ext/ffi/ffi.c
+++ b/ext/ffi/ffi.c
@@ -3544,7 +3544,7 @@ ZEND_METHOD(FFI, scope) /* {{{ */
}
/* }}} */
-static void zend_ffi_cleanup_dcl(zend_ffi_dcl *dcl) /* {{{ */
+void zend_ffi_cleanup_dcl(zend_ffi_dcl *dcl) /* {{{ */
.file "doaddsub.c"
.text
.Ltext0:
.file 0 "/run/media/niels/MoreData/php-src-multitasking" "/run/media/niels/MoreData/php-src-multitasking/ext/bcmath/libbcmath/src/doaddsub.c"
.p2align 4
.globl _bc_do_add
.hidden _bc_do_add
.type _bc_do_add, @function
_bc_do_add:
.LVL0:
.file "doaddsub.c"
.text
.Ltext0:
.file 0 "/run/media/niels/MoreData/php-src-multitasking" "/run/media/niels/MoreData/php-src-multitasking/ext/bcmath/libbcmath/src/doaddsub.c"
.p2align 4
.globl _bc_do_add
.hidden _bc_do_add
.type _bc_do_add, @function
_bc_do_add:
.LVL0:
diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c
index 1e91840ab9f..59abeeffcaa 100644
--- a/ext/bcmath/libbcmath/src/str2num.c
+++ b/ext/bcmath/libbcmath/src/str2num.c
@@ -35,6 +35,32 @@
/* Convert strings to bc numbers. Base 10 only.*/
+#define SWAR_ONES (~((size_t) 0) / 0xFF)
+#define SWAR_REPEAT(x) (SWAR_ONES * (x))
#include "base.h"
int
main(int argc, const char *argv[])
{
if (argc != 2) {
FAILED("Usage: %s <file>", argv[0]);
}
lxb_status_t status;