Skip to content

Commit f0e0040

Browse files
authored
Merge pull request #5 from GDATAAdvancedAnalytics/fix-emu-exception
InstructionEmulator: Fix rare exception caused by null values in arrays
2 parents 5aee68b + e14a3cd commit f0e0040

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

de4dot.blocks/cflow/InstructionEmulator.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,10 @@ void Emulate_Newarr(Instruction instr)
535535
if (val.IsInt32())
536536
{
537537
Int32Value arrSize = (Int32Value)val;
538-
List<Value> arr = new List<Value>(new Value[arrSize.Value]);
538+
List<Value> arr = new List<Value>(arrSize.Value);
539+
for (int i = 0; i < arrSize.Value; i++) {
540+
arr.Add(new UnknownValue());
541+
}
539542
valueStack.Push(new ObjectValue(arr));
540543
}
541544
else

0 commit comments

Comments
 (0)