Permalink
Browse files

render cause segv when call it three time. #12

  • Loading branch information...
chobie committed Mar 9, 2012
1 parent 231bc3c commit 1261851a8ae553c0aea167144bdf000e9c096b26
Showing with 30 additions and 1 deletion.
  1. +1 −1 sundown_markdown.c
  2. +29 −0 tests/999-regression-no12.phpt
View
@@ -573,7 +573,7 @@ PHP_METHOD(sundown_markdown, getExtensions)
zval *result;
result = zend_read_property(sundown_class_entry, getThis(),"extensions",sizeof("extensions")-1, 0 TSRMLS_CC);
- RETVAL_ZVAL(result, 1, 1);
+ RETVAL_ZVAL(result, 1, 0);
}
}
/* }}} */
@@ -0,0 +1,29 @@
+--TEST--
+Check for https://github.com/chobie/php-sundown/issues/12
+--SKIPIF--
+<?php if (!extension_loaded("sundown")) print "skip"; ?>
+--FILE--
+<?php
+$data = <<<EOF
+* Hello World
+
+* * *
+EOF;
+
+$a = new Sundown\Markdown(new Sundown\Render\HTML());
+echo $a->render($data);
+echo $a->render($data);
+echo $a->render($data);
+--EXPECT--
+<ul>
+<li>Hello World</li>
+</ul>
+<hr>
+<ul>
+<li>Hello World</li>
+</ul>
+<hr>
+<ul>
+<li>Hello World</li>
+</ul>
+<hr>

0 comments on commit 1261851

Please sign in to comment.