Skip to content

Commit 6b5aa1c

Browse files
authored
Handle self-assignment gracefully (#8685)
1 parent acb6001 commit 6b5aa1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/jrd/exe.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,12 @@ void EXE_assignment(thread_db* tdbb, const ValueExprNode* to, dsc* from_desc, bo
464464

465465
// Strings will be validated in CVT_move()
466466

467-
if (DTYPE_IS_BLOB_OR_QUAD(from_desc->dsc_dtype) || DTYPE_IS_BLOB_OR_QUAD(to_desc->dsc_dtype))
467+
if (DSC_EQUIV(from_desc, to_desc, false) && from_desc->dsc_address == to_desc->dsc_address)
468+
{
469+
// Self-assignment. No need to do anything.
470+
return;
471+
}
472+
else if (DTYPE_IS_BLOB_OR_QUAD(from_desc->dsc_dtype) || DTYPE_IS_BLOB_OR_QUAD(to_desc->dsc_dtype))
468473
{
469474
// ASF: Don't let MOV_move call blb::move because MOV
470475
// will not pass the destination field to blb::move.

0 commit comments

Comments
 (0)