LiveSplit / livesplit-core

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.

Home Page:https://livesplit.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ASR] Setting variable duing initalization causes panic

apple1417 opened this issue · comments

Minimal example

#include <asr.h>
#include <cstdint>
#include <fstream>
__attribute__((export_name("update"))) void update(void) {std::ifstream dummy{};}

uint32_t set_var(void) {
    timer_set_variable((uint8_t*)"test", 4, (uint8_t*)"test", 4);
    return 1;
}

uint32_t tmp = set_var();

Stack trace goes through

   4: livesplit_auto_splitting::runtime::memory_and_context<asr_debugger::DebuggerTimer>
             at C:\Users\apple1417\.cargo\git\checkouts\livesplit-core-fbf83d991bfbdc2b\80a6d10\crates\livesplit-auto-splitting\src\runtime.rs:673
   5: livesplit_auto_splitting::runtime::bind_interface::closure$22<asr_debugger::DebuggerTimer>
             at C:\Users\apple1417\.cargo\git\checkouts\livesplit-core-fbf83d991bfbdc2b\80a6d10\crates\livesplit-auto-splitting\src\runtime.rs:435
<bunch of wasmtime>
  36: livesplit_auto_splitting::runtime::Runtime<asr_debugger::DebuggerTimer>::new<asr_debugger::DebuggerTimer>
             at C:\Users\apple1417\.cargo\git\checkouts\livesplit-core-fbf83d991bfbdc2b\80a6d10\crates\livesplit-auto-splitting\src\runtime.rs:198
  37: asr_debugger::AppState::set_path
             at P:\ls1-wasm\asr-debugger\src\main.rs:340