int col;
int row;
+ if (!bset1 || !bset2)
+ goto error;
+
total = 1 + isl_basic_set_n_dim(bset1);
row = 0;
--row;
}
}
- isl_basic_set_free(bset2);
isl_assert(bset1->ctx, row == bset1->n_eq, goto error);
+ isl_basic_set_free(bset2);
bset1 = isl_basic_set_normalize_constraints(bset1);
return bset1;
error:
isl_basic_set_free(bset1);
+ isl_basic_set_free(bset2);
return NULL;
}
if (!up)
isl_seq_neg(eq, eq, 1 + dim);
- if (isl_tab_rollback(tab, snap) < 0)
+ if (sample && isl_tab_rollback(tab, snap) < 0)
goto error;
return sample;
goto error;
point = isl_basic_set_from_vec(sample);
hull = affine_hull(hull, point);
+ if (!hull)
+ return NULL;
}
return hull;
else
isl_mat_free(U);
hull = isl_basic_set_preimage(hull, Q);
- isl_vec_free(hull->sample);
- hull->sample = sample;
+ if (hull) {
+ isl_vec_free(hull->sample);
+ hull->sample = sample;
+ } else
+ isl_vec_free(sample);
}
isl_basic_set_free(cone);
if (!T2)
return hull;
- if (!hull)
+ if (!hull) {
isl_mat_free(T1);
- else {
+ isl_mat_free(T2);
+ } else {
struct isl_vec *sample = isl_vec_copy(hull->sample);
if (sample && sample->size > 0)
sample = isl_mat_vec_product(T1, sample);
else
isl_mat_free(T1);
hull = isl_basic_set_preimage(hull, T2);
- isl_vec_free(hull->sample);
- hull->sample = sample;
+ if (hull) {
+ isl_vec_free(hull->sample);
+ hull->sample = sample;
+ } else
+ isl_vec_free(sample);
}
return hull;