gcc/analyzer/ChangeLog:
PR analyzer/100011
* region-model.cc (region_model::on_assignment): Avoid NULL
dereference if ctxt is NULL when assigning from a STRING_CST.
gcc/testsuite/ChangeLog:
PR analyzer/100011
* gcc.dg/analyzer/pr100011.c: New test.
access will "inherit" the individual chars. */
const svalue *rhs_sval = get_rvalue (rhs1, ctxt);
m_store.set_value (m_mgr->get_store_manager(), lhs_reg, rhs_sval,
- BK_default, ctxt->get_uncertainty ());
+ BK_default, ctxt ? ctxt->get_uncertainty () : NULL);
}
break;
}
--- /dev/null
+/* { dg-require-effective-target signal } */
+
+#include <stdlib.h>
+#include <signal.h>
+
+void terminate(int sig)
+{
+ char buf[64] = { 0 };
+ exit(1); /* { dg-warning "call to 'exit' from within signal handler" } */
+}
+
+int main(int argc, char **argv)
+{
+ signal(0, terminate); /* { dg-message "registering 'terminate' as signal handler" } */
+ return 0;
+}