php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56805 "long long" bug
Submitted: 2006-01-27 04:59 UTC Modified: 2013-02-18 00:35 UTC
From: tanguy dot pruvot at gmail dot com Assigned:
Status: No Feedback Package: ffi (PECL)
PHP Version: 5_1 CVS-2006-01-27 OS: Win32 / Unix
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-01-27 04:59 UTC] tanguy dot pruvot at gmail dot com
Description:
------------
Compilation with PHP 5.1.x fails..

i tried to fix it in ffi.h from libffi with :

#elif SIZEOF_LONG_LONG == 8
 #ifdef PHP_WIN32
 # define UINT64  LONG64
 # define SINT64  INT64
 #elif
 # define UINT64  unsigned long long
 # define SINT64  long long
 #endif
#endif

compilation works but php crashes when we call a ffi object method

http://pecl4win.php.net/download.php/blog/5_1/compilelog.txt

Trying php_ffi.dll... FAILED
	"cl.exe" /D COMPILE_DL_FFI /D FFI_EXPORTS=1 /D PHP_LIBFFI_VERSION="2.00-beta" /I"..\pecl_5_0\ffi/libffi/include" /nologo /FD /I . /I main /I regex /I Zend /I TSRM /I ext /D _WINDOWS /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS  /YX  /Zi /LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0 /D ZTS=1 /I "..\php_build\include"  /D FD_SETSIZE=256 /FoRelease_TS\pecl_5_0\ffi\ /FdRelease_TS\pecl_5_0\ffi\ /FpRelease_TS\pecl_5_0\ffi\ /FRRelease_TS\pecl_5_0\ffi\ /c ..\pecl_5_0\ffi\ffi_int64.c ..\pecl_5_0\ffi\ffi_library.c ..\pecl_5_0\ffi\ffi_parser.c ..\pecl_5_0\ffi\ffi_parser_util.c ..\pecl_5_0\ffi\ffi_struct.c ..\pecl_5_0\ffi\php_ffi.c
ffi_int64.c
..\pecl_5_0\ffi\php_ffi_internal.h(25) : warning C4005: 'SINT64' : macro redefinition
        ..\pecl_5_0\ffi/libffi/include\ffi.h(112) : see previous definition of 'SINT64'
..\pecl_5_0\ffi\ffi_int64.c(34) : error C2632: 'long' followed by 'long' is illegal
..\pecl_5_0\ffi\ffi_int64.c(36) : error C2632: 'long' followed by 'long' is illegal

...




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-27 14:12 UTC] tanguy dot pruvot at gmail dot com
the fatal error is in ffi_library.c, in php_ffi_call_method function :

Fixed with try catch at Line 508 :

	zend_try {
		if (args) {
			efree(args);
		}
	
		for (i = 0; i < nargs; i++) {
			if (need_free[i]) {
				efree(values[i]);
			}
		}
	
		if (values) {
			efree(values);
		}
	
		if (return_value_buf) {
			efree(return_value_buf);
		}
	
		if (need_free) {
			efree(need_free);
		}
	}
	zend_catch {} 
	zend_end_try();
 [2006-02-01 07:46 UTC] wez@php.net
Please send a unified diff against CVS
 [2010-05-20 13:14 UTC] tanguy dot pruvot at gmail dot com
Here is the bug fix for Win32/64


Index: ffi_library.c
============================================================
=======
--- ffi_library.c	(r?vision 299526)
+++ ffi_library.c	(copie de travail)
@@ -395,12 +395,22 @@
 	return func;
 }
 
-static union _zend_function *php_ffi_method_get(zval 
*object, char *name, int len TSRMLS_DC)
+static union _zend_function *php_ffi_method_get(
+#if PHP_API_VERSION >= 20041225
+	zval **object_pp,
+#else
+	zval *object,
+#endif
+char *name, int len TSRMLS_DC)
 {
 	zend_internal_function *f;
 	php_ffi_context *obj;
 	php_ffi_function *func;
-	
+
+#if PHP_API_VERSION >= 20041225
+	zval *object = *object_pp;
+#endif
+
 	obj = CTX_FETCH(object);
 
 	func = bind_func(obj, name, len TSRMLS_CC);
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 10:01:27 2019 UTC