Source

pynac-patches / match_paranoia.patch

Full commit
# HG changeset patch
# Parent 46927f52b78acee89b6a475830e47f9b286bf325
diff --git a/ginac/basic.cpp b/ginac/basic.cpp
--- a/ginac/basic.cpp
+++ b/ginac/basic.cpp
@@ -588,7 +588,7 @@
 
 		// Otherwise the subexpressions must match one-to-one
 		for (size_t i=0; i<nops(); i++)
-			if (!op(i).match(pattern.op(i), repl_lst))
+			if (!op(i).match(pattern.sorted_op(i), repl_lst))
 				return false;
 
 		// Looks similar enough, match found
diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp
--- a/ginac/expairseq.cpp
+++ b/ginac/expairseq.cpp
@@ -401,9 +401,9 @@
 		bool has_global_wildcard = false;
 		ex global_wildcard;
 		for (size_t i=0; i<pattern.nops(); i++) {
-			if (is_exactly_a<wildcard>(pattern.op(i))) {
+			if (is_exactly_a<wildcard>(pattern.sorted_op(i))) {
 				has_global_wildcard = true;
-				global_wildcard = pattern.op(i);
+				global_wildcard = pattern.sorted_op(i);
 				break;
 			}
 		}