]> granicus.if.org Git - graphviz/commitdiff
jacobi: fix assertion typo that overwrote matrix value type
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 10 Nov 2021 02:37:55 +0000 (18:37 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 14 Nov 2021 19:00:52 +0000 (11:00 -0800)
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
lib/sfdpgen/sparse_solve.c

index 81d2c6eddec28f450fb84ed11667075155378245..b33b2c0412fe111bb0bb79b10f7353e7bbfa93ce 100644 (file)
@@ -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
 
index 8a9bf15a6acf9b36c49c44ec6508d7f8b1fde77a..274eaa2445d9480cb3d742de3367a53d1b7d19af 100644 (file)
@@ -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++){