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

cmd/compile: typecheck.c illegal member access to n->type member when n->type is nil #8538

Closed
davecheney opened this issue Aug 16, 2014 · 2 comments

Comments

@davecheney
Copy link
Contributor

What steps will reproduce the problem?

-fsanitize=undefined reports

/home/dfc/go/src/cmd/gc/typecheck.c:3326:15: runtime error: member access within null
pointer of type 'Type' (aka 'struct Type')
/home/dfc/go/src/cmd/gc/typecheck.c:3326:15: runtime error: load of null pointer of type
'uchar' (aka 'unsigned char')

typecheckdeftype will set n->type = T if an error occurs, but line 3326 tries to
access members of n->type unconditionally.

This only happens when compilation is a failure, but should probably be fixed.

What is the expected output? What do you see instead?


Please use labels and text to provide additional information.
@rsc
Copy link
Contributor

rsc commented Sep 15, 2014

Comment 2:

Don't care much about undefined C unless they are causing real problems. 8527 was not
undefined C. All this C code is going away. The less time we spend on it, the sooner
that happens.

Labels changed: added release-none, removed release-go1.4.

Status changed to Accepted.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/gc: typecheck.c illegal member access to n->type member when n->type is nil cmd/compile: typecheck.c illegal member access to n->type member when n->type is nil Jun 8, 2015
@ALTree
Copy link
Member

ALTree commented Aug 10, 2017

That C code in the compiler was deleted a long time ago, so I'm closing this.

@ALTree ALTree closed this as completed Aug 10, 2017
@golang golang locked and limited conversation to collaborators Aug 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants