You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SlithIR is not properly generated after a usage of an aliased-imported-library-type array. A more specific example can be found in the reproducer, but in short, having an import like import {DataTypes as dt} from "./DataTypes.sol"; and then declaring a variable like dt.Type[] memory v = ... causes slither to fail silently with log message Missing function Type not found dt.Type. This then causes the IRs for the current function and every function defined after it in the same contract to not be generated.
pragma solidity^0.8.0;
import {DataTypes as dt} from"./DataTypes.sol";
contractTest {
function functionWithIRs(boolx, booly) publicreturns (bool) {
bool b1 = x && y;
bool b2 = x || y;
return b1 && b2;
}
function hasBoolPair() publicreturns (bool) {
bool b =true;
dt.BoolPair memory bp = dt.BoolPair(true, false);
return b;
}
function hasBoolPairArray() publicreturns (bool) {
bool b =true;
dt.BoolPair[] memory bpArr =new dt.BoolPair[](0);
return b;
}
function sameAsFirstFunction(boolx, booly) publicreturns (bool) {
bool b1 = x && y;
bool b2 = x || y;
return b1 && b2;
}
}
Version:
0.9.2
Relevant log output:
From using the slithir printer on the reproducer:
Contract DataTypes
Missing functionType not found dt.BoolPair
Missing functionType not found dt.BoolPair
Contract DataTypes
Contract Test
Function Test.functionWithIRs(bool,bool) (*)
Expression: b1 = x && y
IRs:
TMP_0(bool) = x && y
b1(bool) := TMP_0(bool)
Expression: b2 = x || y
IRs:
TMP_1(bool) = x || y
b2(bool) := TMP_1(bool)
Expression: b1 && b2
IRs:
TMP_2(bool) = b1 && b2
RETURN TMP_2
Function Test.hasBoolPair() (*)
Expression: b = true
IRs:
b(bool) := True(bool)
Expression: bp = DataTypes.BoolPair(true,false)
IRs:
TMP_3 = new BoolPair(True,False)
bp(DataTypes.BoolPair) := TMP_3(DataTypes.BoolPair)
Expression: b
IRs:
RETURN b
Function Test.hasBoolPairArray() (*)
Function Test.sameAsFirstFunction(bool,bool) (*)
The text was updated successfully, but these errors were encountered:
Describe the issue:
SlithIR is not properly generated after a usage of an aliased-imported-library-type array. A more specific example can be found in the reproducer, but in short, having an import like
import {DataTypes as dt} from "./DataTypes.sol";
and then declaring a variable likedt.Type[] memory v = ...
causes slither to fail silently with log messageMissing function Type not found dt.Type
. This then causes the IRs for the current function and every function defined after it in the same contract to not be generated.Code example to reproduce the issue:
In DataTypes.sol:
In Test.sol:
Version:
0.9.2
Relevant log output:
The text was updated successfully, but these errors were encountered: