mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-05 11:12:49 +00:00
reg3:: crash when matrix_order result appears to be greater than 1000
This commit is contained in:
parent
2ccba49023
commit
39c7004747
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user