#I need help (quite dire)

25 messages · Page 1 of 1 (latest)

prisma silo
fleet monolithBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

spare tinsel
#

Try using address sanatizers

fleet monolithBOT
#
How To Use Sanitizers

Sanitizers are tools which generate additional code in your program that can catch many common programming mistakes,
such as:

General Advice

Not all sanitizers can be combined, but when they can, use e.g.:
-fsanitize=address,undefined to combine them.
Always compile with debug info to get line numbers, variable names, etc.

MSVC 19.27+ and VS 2019 16.9+
Sample Program
int main(void) {
    int x;
    return x;
}
`-fsanitize=memory -g` Output

SUMMARY: MemorySanitizer: use-of-uninitialized-value /tmp/test.cpp:3:5 in main
Exiting
(3:5 is line and column of return)

prisma silo
#

Did u even look at my code

#

ok

#

@spare tinsel did not work ._.

spare tinsel
#

did you also try the undefined sanitizer?

prisma silo
#

it caught no errors

#

I did

#

I even added an -std=c++20 just to b sure

spare tinsel
#

How do you change the dimensions?

prisma silo
spare tinsel
#

So I used address santizier and got this

#

somewhere at this line

for (uint8_t i = 0; i < size(cols); i++) if (uint16_t(text[(i * cols.size()) + x].length()) < uint16_t(cols[x] - 1)) j++;

you are reading invalid memory

#

change the [] to .at(), I got this

RRADIX TERMSHEETS - 01 rows x 07 columns
______________________________________________________________________
_________._________|_________|_________|_________|_________|_________|

X: 0
Y: 0

terminate called after throwing an instance of 'std::out_of_range'
  what():  deque::_M_range_check: __n (which is 7)>= this->size() (which is 7)
prisma silo
#

thx cuhs

prisma silo
#

@spare tinsel

spare tinsel
#

/cppref query:deque::at

#

/cppref query:deque::at

#

!cppref deque::at

fleet monolithBOT
fleet monolithBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.