Currently Prolog.rewriteVariable() works with the assumption that hashing a variable name together with an integer won't ever produce a collision with an existing variable:
|
function rewriteVariable(uint _symbol, uint _uniqueContext) private pure returns (uint) { |
|
bytes32[] memory input = new bytes32[](2); |
|
input[0] = bytes32(_symbol); |
|
input[1] = bytes32(_uniqueContext); |
|
return uint(keccak256(abi.encodePacked(input))); |
|
} |
A collision unlikely but not impossible. We may want to use a safer method of obtaining fresh variable names.
Currently
Prolog.rewriteVariable()works with the assumption that hashing a variable name together with an integer won't ever produce a collision with an existing variable:SolPrologV2/src/Prolog.sol
Lines 77 to 82 in 47bb8ec
A collision unlikely but not impossible. We may want to use a safer method of obtaining fresh variable names.