Skip to content

Commit 9be58bd

Browse files
ctf: fix bug of identifier being incorrect in declarationscope
Found with CodeRabbit. Change-Id: Ifa4be68a71fc98e6ca4604c290d50d6840746451 Signed-off-by: Matthew Khouzam <[email protected]>
1 parent d756984 commit 9be58bd

File tree

1 file changed

+1
-2
lines changed
  • ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/metadata

1 file changed

+1
-2
lines changed

ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/metadata/DeclarationScope.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,10 @@ public void registerType(String name, IDeclaration declaration)
197197
*/
198198
public void registerIdentifier(String name, IDeclaration declaration) throws ParseException {
199199
/* Check if the type has been defined in the current scope */
200-
IDeclaration iDeclaration = fIdentifiers.get(declaration);
200+
IDeclaration iDeclaration = fIdentifiers.get(name);
201201
if (iDeclaration != null && !Objects.equals(iDeclaration, declaration)) {
202202
throw new ParseException("Identifier has already been defined:" + name); //$NON-NLS-1$
203203
}
204-
205204
/* Add it to the register. */
206205
fIdentifiers.put(name, declaration);
207206
}

0 commit comments

Comments
 (0)