FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.
https://docs.fuel.network/docs/sway/
Apache License 2.0
62.58k stars 5.37k forks source link

fix OOB slab panic when creating runnables on a did_save event #6575

Closed JoshuaBatty closed 1 month ago

JoshuaBatty commented 1 month ago

Description

I noticed that the language server would crash when compilation was triggered from a did save event as we were trying to create runnables from the Engines that had GC applied to it. We now check to ensure that the correct Engines is accessed to avoid a panic when creating runnables.

After fixing this bug, I noticed that optimised builds was not returning diagnostics. I've opened #6576 to work on this and have temporarily disabled the optimisation so diagnostics continue to work.

Checklist

codspeed-hq[bot] commented 1 month ago

CodSpeed Performance Report

Merging #6575 will degrade performances by 18.06%

Comparing josh/panic_on_save (8cc5062) with master (28c8ae4)

Summary

❌ 1 regressions ✅ 21 untouched benchmarks

:warning: _Please fix the performance issues or acknowledge them on CodSpeed._

Benchmarks breakdown

Benchmark master josh/panic_on_save Change
document_symbol 4.4 ms 5.4 ms -18.06%