@@ -30,7 +30,7 @@ static int rewrite_branch(struct basic_block *bb,
struct basic_block *old,
struct basic_block *new)
{
- if (*ptr != old || new == old)
+ if (*ptr != old || new == old || !bb->ep)
return 0;
/* We might find new if-conversions or non-dominating CSEs */
new file mode 100644
@@ -0,0 +1,24 @@
+void a(int c, int e)
+{
+ for(; b; c ;
+
+ if (()) {
+ unsigned short d = e;
+ if (())
+ while ()
+ ;
+ &d;
+ }
+
+ if (()) {
+ int f = &f;
+ }
+}
+
+/*
+ * check-name: crash rewrite_branch
+ * check-command: test-linearize $file
+ *
+ * check-error-ignore
+ * check-output-ignore
+ */
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- flow.c | 2 +- validation/crash-rewrite-branch.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 validation/crash-rewrite-branch.c