Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c zend_API.h zend_exceptions.c

From: Date: Thu, 18 Aug 2005 17:22:10 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_API.c zend_API.h zend_exceptions.c
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4045@lists.php.net to get a copy of this message
On Aug 18, 2005, at 8:42 AM, Dmitry Stogov wrote:
+ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object, UChar *name, int name_length, char *value TSRMLS_DC) +{ + zval *tmp; + + ALLOC_ZVAL(tmp); + tmp->is_ref = 0; + tmp->refcount = 0; + ZVAL_UNICODE(tmp, value, 1); + zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); +} + +ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval *object, UChar *name, int name_length, char *value, int value_len TSRMLS_DC) +{ + zval *tmp; + + ALLOC_ZVAL(tmp); + tmp->is_ref = 0; + tmp->refcount = 0; + ZVAL_UNICODEL(tmp, value, value_len, 1); + zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); +} + ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC)
[snipped]
if (message) { - zend_update_property_string(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, message TSRMLS_CC); + if (message_type == IS_UNICODE) { + zend_update_property_unicodel(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, message, message_len TSRMLS_CC); + } else { + zend_update_property_stringl(U_CLASS_ENTRY(default_exception_ce), object, "message", sizeof("message")-1, message, message_len TSRMLS_CC); + } }
Dmitriy, Your function prototypes indicate that the name passed in should be a UChar* but you are passing a simple C string.. -Andrei

« previous php.zend-engine.cvs (#4045) next »