[match-and-simplify] set simplify::capture_max to 0 if pattern contains no captures

Prathamesh Kulkarni prathamesh.kulkarni@linaro.org
Sun Dec 14 21:39:00 GMT 2014


Caused segfault for pattern containing no captures at:
info.safe_grow_cleared(capture_max + 1); in capture_info::capture_info

artificial test-case:
(define_predicates integer_zerop)
(simplify
  (bit_not integer_zerop)
  { build_zero_cst (type); })

* genmatch.c
  (simplify::simplify): Set simplify::capture_max to 0 if pattern
contains no captures.

Thanks,
Prathamesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: capture_max.patch
Type: text/x-patch
Size: 646 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141214/b02a031e/attachment.bin>


More information about the Gcc-patches mailing list