+2014-12-12 Daiki Ueno <ueno@gnu.org>
+
+ * format-lisp.c (make_intersected_list): Don't dereference
+ potentially released memory. 'append_repeated_to_initial' may
+ release the LIST->element. Spotted by clang-analyzer.
+ * format-scheme.c (make_intersected_list): Likewise.
+
2014-12-10 Daiki Ueno <ueno@gnu.org>
* msgl-check.c (check_header_entry): Don't declare unused variable
/* Intersect the argument types. */
if (!make_intersected_element (re, e1, e2))
{
+ bool re_is_required = re->presence == FCT_REQUIRED;
+
append_repeated_to_initial (result);
/* If re->presence == FCT_OPTIONAL, the result list ends here. */
- if (re->presence == FCT_REQUIRED)
+ if (re_is_required)
/* Contradiction. Backtrack. */
result = backtrack_in_initial (result);
/* Intersect the argument types. */
if (!make_intersected_element (re, e1, e2))
{
+ bool re_is_required = re->presence == FCT_REQUIRED;
+
append_repeated_to_initial (result);
/* If re->presence == FCT_OPTIONAL, the result list ends here. */
- if (re->presence == FCT_REQUIRED)
+ if (re_is_required)
/* Contradiction. Backtrack. */
result = backtrack_in_initial (result);