Throw an error if a child attached by reference to a parent is compiled.
Fixes #2482. PiperOrigin-RevId: 735665098 Change-Id: Ia3436fdd2ff572f8f0c1ded434742a4a9186f2f7
This commit is contained in:
committed by
Copybara-Service
parent
14dc6fd33b
commit
019e0a806c
@@ -3972,6 +3972,9 @@ mjModel* mjCModel::Compile(const mjVFS* vfs, mjModel** m) {
|
||||
warningtext[0] = 0;
|
||||
|
||||
try {
|
||||
if (attached_) {
|
||||
throw mjCError(0, "cannot compile child spec if attached by reference to a parent spec");
|
||||
}
|
||||
if (setjmp(error_jmp_buf) != 0) {
|
||||
// TryCompile resulted in an mju_error which was converted to a longjmp.
|
||||
std::string error_msg = errortext;
|
||||
|
||||
Reference in New Issue
Block a user