upd: fix some UB

This commit is contained in:
2023-11-10 12:13:19 +08:00
parent 0166ad5798
commit c21d0b452b

View File

@ -175,6 +175,7 @@ std::any Add(std::any a, std::any b) {
throw FatalError("Add: Type Error", 38);
}
std::any Sub(std::any a, std::any b) {
if (std::any_cast<std::string>(&b) != nullptr) b = ZYM::int2048(0);
if (std::any_cast<NoneType>(&a)) a = (bool)false;
if (std::any_cast<NoneType>(&b)) b = (bool)false;
ConverToSameArithType(a, b);