mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-09-06 04:17:58 +00:00
reg3:: crash when matrix_order result appears to be greater than 1000
This commit is contained in:
1
reg3.cpp
1
reg3.cpp
@@ -2883,6 +2883,7 @@ EX int matrix_order(const transmatrix A) {
|
|||||||
transmatrix T = A;
|
transmatrix T = A;
|
||||||
int res = 1;
|
int res = 1;
|
||||||
while(!eqmatrix(T, Id)) {
|
while(!eqmatrix(T, Id)) {
|
||||||
|
if(res >= 1000) throw hr_exception("matrix_order failed");
|
||||||
res++; T = T * A;
|
res++; T = T * A;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
Reference in New Issue
Block a user