This project has moved and is read-only. For the latest updates, please go here.

V8 Null Pointer crash when using "for (let a of hostObj)"

Sep 16, 2016 at 10:18 PM
In my application, the following code works for two successive calls but then causes a null pointer crash in v8-x64.dll during the third call:
function volumeOperation(choiceResults) {
    for (let c of choiceResults) {
        // anything here
where choiceResults is a Dictionary<string, List<object>> passed in via a callback call. If I change this code to the following:
function volumeOperation(choiceResults) {
    const results = choiceResults.GetEnumerator();
    while (results.MoveNext()) {
        const c = results.Current;
        // anything here
it does not crash. I've tried to reproduce this in C# Interactive but I was not successful. Hopefully this is useful anyway, but let me know if there's any additional information or experimenting I can provide to help narrow it down (or if I've done something wrong).

I'm using the NuGet ClearScript.V8 5.4.6 package, and here's the crash dialog in case it is helpful: crash dialog

Sep 17, 2016 at 10:43 PM
Hi Mike,

Thanks for reporting this. It appears to be due to a bug in V8's optimization or JIT compilation logic. Luckily it's easy to work around. We'll post a fix shortly.

Thanks again!
Nov 2, 2016 at 2:04 PM
Fixed in Version 5.4.8.