IRC channel logs
2025-11-30.log
back to list of logs
<matrix_bridge><Andrius Štikonas> something is different in my reproducer then... <matrix_bridge><Andrius Štikonas> ok, it's because one is static array, the other is calloc'ed pointer <matrix_bridge><gtker> stikonas: I think it's because the type is a "int*" instead of "int", since it's incrementing by sizeof(int) <matrix_bridge><Andrius Štikonas> gtker: but int has the same size, doens't it? <matrix_bridge><Andrius Štikonas> well, I guess it's just applying pointer arithmetic <matrix_bridge><Andrius Štikonas> well with current parser, we won't be able to fix all corner cases, but I guess this one is still widely used... <matrix_bridge><Andrius Štikonas> e.g. our parser looks for 2 tokens back before [ for prefix operators, but one can add ( around variables... <matrix_bridge><gtker> Yeah, exactly. I think "current_type" comparison method is just inherently bad since not every operation correctly sets it. Ultimately the solution is to parse into an AST and potentially then into other more convenient forms, but I don't really have the time right now for that kind of work 🙂 <matrix_bridge><gtker> I think in theory we could make a small change where we just eat the potentially infinite lookahead and just see if there's a "=" token before a ";" in order to detect the current status, but that's also not bulletproof for something like "a + b[0] = 1;", which wouldn't be detected correctly <matrix_bridge><Andrius Štikonas> yeah, I guess I should not convert this particular case to postfix increment in mescc-tools-extra... <matrix_bridge><Andrius Štikonas> I have a yet unpushed commit that switches a lot of expresisons like "i = i + 1" to "i++"