duan0821 2012-04-22 12:38
浏览 47
已采纳

使用ZVAL_STRING避免PHP引擎崩溃

In an extension, what can I do to avoid the crash of the php engine when zval string is allocated by myself ?

..
// will do implicitly ZVAL_STRING("tmp", "/tmp", 0); 
// 
SET_VAR_STRING("tmp", "/tmp");
..

php_embed_shutdown(TSRMLS_C);   // GPF !!

Any ideas?

  • 写回答

1条回答 默认 最新

  • dongzhao8233 2012-04-22 16:54
    关注

    Change it to:

    SET_VAR_STRING("tmp", estrdup("/tmp"));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?