Skip to content

[BUG] JS script print(0.5) caused a crash #2861

@MikanHako1024

Description

@MikanHako1024

Build by this

cmake -G "Visual Studio 17 2022" -DBUILD_SDLGPU=On -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=ON ..
cmake --build . --config MinSizeRel --parallel

Then run tic80.exe and run this script

// script:  js
function TIC() {
	print(0.5);
}

This will cause the program to crash.

I tried debugging it and found that error Integer division by zero occurred here:

bool done = config->init((tic_mem*)core, code);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions