Merge pull request #8420 from mijovic/iceStackTooDeepFix

Throwing stack too deep ICE in case of calling encode with too many a…
This commit is contained in:
Daniel Kirchner
2020-03-04 17:41:59 +01:00
committed by GitHub
+4
View File
@@ -539,6 +539,10 @@ void CompilerUtils::encodeToMemory(
if (targetType->isDynamicallySized() && !_copyDynamicDataInPlace)
{
// copy tail pointer (=mem_end - mem_start) to memory
solAssert(
(2 + dynPointers) <= 16,
"Stack too deep(" + to_string(2 + dynPointers) + "), try using fewer variables."
);
m_context << dupInstruction(2 + dynPointers) << Instruction::DUP2;
m_context << Instruction::SUB;
m_context << dupInstruction(2 + dynPointers - thisDynPointer);