aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-streamer-out.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-11-25 14:41:50 +0100
committerMartin Liska <mliska@suse.cz>2021-11-26 14:55:12 +0100
commitf1ec39c86c3a5523ec305cc05102ed1e6afbce9c (patch)
treeb8f1896c813967bd86ac1a4fdccfb6d419fce87b /gcc/tree-streamer-out.c
parent2cadaa1f134beca5ec63544f185362c223bab590 (diff)
downloadgcc-f1ec39c86c3a5523ec305cc05102ed1e6afbce9c.zip
gcc-f1ec39c86c3a5523ec305cc05102ed1e6afbce9c.tar.gz
gcc-f1ec39c86c3a5523ec305cc05102ed1e6afbce9c.tar.bz2
d: fix ASAN in option processing
Fixes: ==129444==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000666ca5c at pc 0x000000ef094b bp 0x7fffffff8180 sp 0x7fffffff8178 READ of size 4 at 0x00000666ca5c thread T0 #0 0xef094a in parse_optimize_options ../../gcc/d/d-attribs.cc:855 #1 0xef0d36 in d_handle_optimize_attribute ../../gcc/d/d-attribs.cc:916 #2 0xef107e in d_handle_optimize_attribute ../../gcc/d/d-attribs.cc:887 #3 0xff85b1 in decl_attributes(tree_node**, tree_node*, int, tree_node*) ../../gcc/attribs.c:829 #4 0xef2a91 in apply_user_attributes(Dsymbol*, tree_node*) ../../gcc/d/d-attribs.cc:427 #5 0xf7b7f3 in get_symbol_decl(Declaration*) ../../gcc/d/decl.cc:1346 #6 0xf87bc7 in get_symbol_decl(Declaration*) ../../gcc/d/decl.cc:967 #7 0xf87bc7 in DeclVisitor::visit(FuncDeclaration*) ../../gcc/d/decl.cc:808 #8 0xf83db5 in DeclVisitor::build_dsymbol(Dsymbol*) ../../gcc/d/decl.cc:146 for the following test-case: gcc/testsuite/gdc.dg/attr_optimize1.d. gcc/d/ChangeLog: * d-attribs.cc (parse_optimize_options): Check index before accessing cl_options.
Diffstat (limited to 'gcc/tree-streamer-out.c')
0 files changed, 0 insertions, 0 deletions