Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable sometimes malfunctions #52

Open
dvdsk opened this issue Dec 2, 2021 · 1 comment
Open

Disable sometimes malfunctions #52

dvdsk opened this issue Dec 2, 2021 · 1 comment
Assignees
Labels
Critical Something broke the code

Comments

@dvdsk
Copy link
Owner

dvdsk commented Dec 2, 2021

(non minimal) example:

#include "util.hpp"
#include <limits>
#include <random>
#include <stdlib.h>
#include <algorithm>

using std::vector;

vector<uint32_t> random_arry(int n, int seed) {

	std::mt19937 rng(seed);

	auto max = std::numeric_limits<uint32_t>::max();
	std::uniform_int_distribution<uint32_t> dist(0, max);
	auto generator = [&dist, &rng](){ return dist(rng); };

	vector<uint32_t> data(n);
	std::generate(data.begin(), data.end(), generator);
		
	// return value optimization will prevent copy
	return data;
}

// checks if data in array is sorted in ascending order
bool is_sorted(vector<uint32_t> data) {
	auto prev = 0;
	for(const auto& n : data) {
		
	}
}

is sorted is highlighted and PsDisable gives a stack traceback:

E5108: Error executing lua ...start/prosesitter/lua/prosesitter/linter/check/check.lua:45: attempt to index local 'self' (a nil value)
stack traceback:
        ...start/prosesitter/lua/prosesitter/linter/check/check.lua:45: in function 'cancelled_schedualled'
        ...start/prosesitter/lua/prosesitter/linter/check/check.lua:63: in function 'disable'
        ...er/start/prosesitter/lua/prosesitter/linter/on_event.lua:140: in function 'disable'
        ...m/site/pack/packer/start/prosesitter/lua/prosesitter.lua:50: in function 'disable'
        [string ":lua"]:1: in main chunk
@dvdsk dvdsk added the Critical Something broke the code label Dec 2, 2021
@dvdsk
Copy link
Owner Author

dvdsk commented Feb 10, 2022

TODO add a test :)

@dvdsk dvdsk self-assigned this Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical Something broke the code
Projects
None yet
Development

No branches or pull requests

1 participant