Skip to content

Commit

Permalink
USE_GLM bugfix: EnvMgr::setProperty() length check in wrong place.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robadob committed Feb 8, 2022
1 parent 0e4a25f commit 949aba8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/flamegpu/runtime/utility/EnvironmentManager.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -903,18 +903,18 @@ T EnvironmentManager::setProperty(const NamePair &name, const T &value) {
"in EnvironmentManager::setProperty().",
name.first, name.second.c_str(), typ_id.name(), typeid(T).name());
}
#endif
if (isConst(name)) {
THROW exception::ReadOnlyEnvProperty("Environmental property ('%u:%s') is marked as const and cannot be changed, "
"in EnvironmentManager::setProperty().",
name.first, name.second.c_str());
}
const size_type array_len = length(name);
if (array_len != 1) {
THROW exception::InvalidEnvPropertyType("Named environmental property is an array of length %u, the array function must be used! "
"in EnvironmentManager::setProperty().",
array_len);
}
#endif
if (isConst(name)) {
THROW exception::ReadOnlyEnvProperty("Environmental property ('%u:%s') is marked as const and cannot be changed, "
"in EnvironmentManager::setProperty().",
name.first, name.second.c_str());
}
// Copy old data to return
T rtn = getProperty<T>(name);
std::unique_lock<std::shared_timed_mutex> lock(mutex);
Expand Down

0 comments on commit 949aba8

Please sign in to comment.