Skip to content

Program received signal SIGSEGV, Segmentation fault #6

@pointhi

Description

@pointhi

I found a code snippet which results in a segfault of the interpreter

#define TEST
#include "tcl.c"

#define TCL_BENCH "set i 0; while {< $i 1} {if {== [- $i] -1} {} {set i [+ $i 1]}}"

int main() {
    struct tcl tcl;
    tcl_init(&tcl);

    tcl_eval(&tcl, TCL_BENCH, sizeof(TCL_BENCH));

    tcl_destroy(&tcl);

    return 0;
}

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