I was reading the detection of same function reentrancy by Zeus tool as discussed in [http://pages.cpsc.ucalgary.ca/~joel.reardon/blockchain/readings/ndss2018_09-1_Kalra_paper.pdf
]. They have done cloning. I can’t understand this method. Is this a valid method of testing a SCsmart Contract (SC) because we are modifying the SC? Can we modify the SC during testing?
The paper says:
Reentrancy in Solidity can happen via the call method. send only invokes the default function with limited gas for logging purposes. ZEUS handles same-function reentrancy by first cloning the function under consideration, and inserting a call to the clone before the invocation to call. Fig. 14 shows the patched function for the example in Fig. 2. Note that ZEUS ensures that the patch is done within the same basic block so as to ensure that if the cloned function is called, then the invocation to call is also made. Further, we also assert false before the call code. If the verifier finds a path leading to this assert, it indicates a bug.
Somebody please help me to understand