Skip to content

Better error message when module is not linked. #98

@stroiman

Description

@stroiman

In my code, I call

mod, err := sobek.ParseModule( ... )
mod.Evaluate(vm)

The code results in a nil panic in vm.go:639, which goes away if I call mod.Link()

func (vm *vm) run() {
	// ...
	for {
		// ...
		pc := vm.pc
		if pc < 0 || pc >= len(vm.prg.code) { // <- nil pointer panic here
			break
		}
		// ...
	}

	// ...
}

Perhaps a more helpful error message would be nice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions