Open mgaudet opened 6 years ago
Adding a small test case to the ILValidator test shows what's going on here quite clearly:
diff --git a/fvtest/compilertriltest/ILValidatorTest.cpp b/fvtest/compilertriltest/ILValidatorTest.cpp index 0fe1e286..3348177c 100644 --- a/fvtest/compilertriltest/ILValidatorTest.cpp +++ b/fvtest/compilertriltest/ILValidatorTest.cpp @@ -65,6 +65,11 @@ INSTANTIATE_TEST_CASE_P(ILValidatorChildrenCountDeathTest, IllformedTrees, ::tes "(method return=Int64 (block (lreturn (ladd (lconst 1) (lconst 1) (lconst 1)))))" )); +INSTANTIATE_TEST_CASE_P(ILValidatorReturnMismatchDeathTest, IllformedTrees, ::testing::Values( + "(method return=Int32 (block (lreturn (lconst 1) )))" // incorrect return type of sig + )); + +
Essentially, the declared return type of a function isn't checked against the return opcode generated for that function -- so, the above currently validates.
We may need to revisit the DeathTests due to #1881 and the significant amount of time they take to run on OS X.
Adding a small test case to the ILValidator test shows what's going on here quite clearly:
Essentially, the declared return type of a function isn't checked against the return opcode generated for that function -- so, the above currently validates.