Changeset 0ca15b7 for libcfa/src/containers/string_res.cfa
- Timestamp:
- Oct 19, 2021, 9:55:27 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 2b30370
- Parents:
- fe18b46
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/string_res.cfa
rfe18b46 r0ca15b7 405 405 406 406 verify( shareEditSetEndPeer->Handle.s >= shareEditSetStartPeer->Handle.s ); 407 size_t editSetLength = shareEditSetEndPeer->Handle.s + shareEditSetEndPeer->Handle.lnth - shareEditSetStartPeer->Handle.s;408 verify( editSetLength >= this.Handle.lnth );407 size_t origEditSetLength = shareEditSetEndPeer->Handle.s + shareEditSetEndPeer->Handle.lnth - shareEditSetStartPeer->Handle.s; 408 verify( origEditSetLength >= this.Handle.lnth ); 409 409 410 410 if ( this.shareEditSet_owns_ulink ) { // assigning to private context … … 418 418 if ( char * oldBytes = VbyteTryAdjustLast( *this.Handle.ulink, delta ) ) { 419 419 // growing: copy from old to new 420 char * dest = VbyteAlloc( *this.Handle.ulink, editSetLength);420 char * dest = VbyteAlloc( *this.Handle.ulink, origEditSetLength + delta ); 421 421 char *destCursor = dest; memcpy(destCursor, prefixStartOrig, prefixLen); 422 422 destCursor += prefixLen; memcpy(destCursor, buffer , bsize ); … … 424 424 assignEditSet(this, shareEditSetStartPeer, shareEditSetEndPeer, 425 425 dest, 426 editSetLength,426 origEditSetLength + delta, 427 427 0p, bsize); 428 428 free( oldBytes ); … … 434 434 assignEditSet(this, shareEditSetStartPeer, shareEditSetEndPeer, 435 435 shareEditSetStartPeer->Handle.s, 436 editSetLength,436 origEditSetLength + delta, 437 437 0p, bsize); 438 438 } 439 439 440 440 } else if ( // assigning to shared context 441 this.Handle.lnth == editSetLength &&// overwriting entire run of SES441 this.Handle.lnth == origEditSetLength && // overwriting entire run of SES 442 442 & valSrc && // sourcing from a managed string 443 443 valSrc.Handle.ulink == this.Handle.ulink ) { // sourcing from same heap
Note: See TracChangeset
for help on using the changeset viewer.