Comments (3)
Fixed by something like:
diff --git a/src/aro/Parser.zig b/src/aro/Parser.zig
index ebaa318..3b84321 100644
--- a/src/aro/Parser.zig
+++ b/src/aro/Parser.zig
@@ -2980,6 +2980,7 @@ fn directDeclarator(p: *Parser, base_type: Type, d: *Declarator, kind: Declarato
if (max_bits > 61) max_bits = 61;
const max_bytes = (@as(u64, 1) << @truncate(max_bits)) - 1;
+ if (size.ty.is(.invalid)) return Type.invalid;
if (!size.ty.isInt()) {
try p.errStr(.array_size_non_int, size_tok, try p.typeStr(size.ty));
return error.ParsingFailed;
from arocc.
Here's an alternate path to trigger it:
struct Foo {
int a;
} a;
char *f(char *arg) {
return arg + a?a;
}
Do you think we should check in the typeStr functions? I'm guessing any place we call that could potentially have an invalid type
from arocc.
That would solve the issue but it'd be nicer to properly handle invalid
where needed. Maybe we could add a release mode check for invalid
in typeStr*
so that release modes don't crash?
from arocc.
Related Issues (20)
- Crash: record with oversize array HOT 1
- Crash: assign to pointer to incomplete enum
- Enums types with fixed underlying type should compare equal to underlying type
- Fixed-underlying-type enums should enforce non-enum integral underlying type
- Crash: non-evaluated floating point comparison in boolean `or`
- Preprocessor allows extraneous tokens in preprocessor expression
- Integer literal promotion rules should emulate chosen compiler
- Incorrect sizeof for typeof incomplete array HOT 1
- Memory leak in preprocessor - indirect invocation of macro with incorrect number of arguments
- Print _BitInt size in diagnostics
- Warn if implicit integer conversion truncates value HOT 1
- Crash: redefining variable as `__auto_type` and assigning to self
- Crash: array subscript with string
- Crash: initializing pointer to typeof-invalid
- `__TIMESTAMP__` macro has incorrect value
- Aro's generated modules have generic names that flow to consuming projects HOT 2
- Support MSVC `__pragma`
- Support common linker flags
- Define __STDC_EMBED macros
- Remove calls to `std.meta.fields`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arocc.