From 8b2986b9a1b0cb1052eaf3238c3476614ad8eaf6 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 9 Nov 2021 18:37:55 -0800 Subject: [PATCH] jacobi: fix assertion typo that overwrote matrix value type Comparing to the surrounding functions in this file, this was clearly meant to be checking the type of the matrix not setting it. This was benign as, due to a separate problem, assertions are disabled in this file, making this a no-op. The next commit will re-enable assertions, which caused this issue to be discovered through a compiler error. --- CHANGELOG.md | 1 + lib/sfdpgen/sparse_solve.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81d2c6edd..b33b2c041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Lefty artifacts are no longer installed when Lefty is disabled #2153 - Smyrna artifacts are no longer installed when Smyrna is disabled - calling convention mismatches in delaunay.c’s GTS code +- impure assertion in `jacobi` ## [2.49.3] – 2021-10-22 diff --git a/lib/sfdpgen/sparse_solve.c b/lib/sfdpgen/sparse_solve.c index 8a9bf15a6..274eaa244 100644 --- a/lib/sfdpgen/sparse_solve.c +++ b/lib/sfdpgen/sparse_solve.c @@ -244,7 +244,7 @@ static real* jacobi(SparseMatrix A, int dim, real *x0, real *rhs, int maxit, int x = MALLOC(sizeof(real)*n); y = MALLOC(sizeof(real)*n); b = MALLOC(sizeof(real)*n); - assert(A->type = MATRIX_TYPE_REAL); + assert(A->type == MATRIX_TYPE_REAL); ia = A->ia; ja = A->ja; a = (real*) A->a; for (k = 0; k < dim; k++){ -- 2.40.0