Skip to content

Commit

Permalink
[Trivial] fix code loc
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed May 14, 2013
1 parent 5a13070 commit 2a1b447
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/clone.c
Expand Up @@ -428,7 +428,8 @@ FuncDeclaration *StructDeclaration::buildXopEquals(Scope *sc)
* return p == q;
* }
*/
Loc loc = Loc(); // errors are gagged, so loc is not need
Loc declLoc = Loc(); // loc is unnecessary so __xopEquals is never called directly
Loc loc = Loc(); // loc is unnecessary so errors are gagged

Parameters *parameters = new Parameters;
parameters->push(new Parameter(STCref | STCconst, type, Id::p, NULL));
Expand All @@ -437,11 +438,11 @@ FuncDeclaration *StructDeclaration::buildXopEquals(Scope *sc)
tf = (TypeFunction *)tf->semantic(loc, sc);

Identifier *id = Lexer::idPool("__xopEquals");
FuncDeclaration *fop = new FuncDeclaration(loc, Loc(), id, STCstatic, tf);
FuncDeclaration *fop = new FuncDeclaration(declLoc, Loc(), id, STCstatic, tf);

Expression *e1 = new IdentifierExp(loc, Id::p);
Expression *e2 = new IdentifierExp(loc, Id::q);
Expression *e = new EqualExp(TOKequal, Loc(), e1, e2);
Expression *e = new EqualExp(TOKequal, loc, e1, e2);

fop->fbody = new ReturnStatement(loc, e);

Expand Down

0 comments on commit 2a1b447

Please sign in to comment.