From 39831b1d17abd360b1d50c8820f09cfd095be337 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 22 Nov 2013 17:28:08 +0100 Subject: Fix unoidl sourceprovider recursive struct/exception member check Change-Id: Icd156745da10011611590b6b62cd0ec2df2b1266 --- unoidl/source/sourceprovider-parser.y | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'unoidl/source') diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y index 9d1c97ac4239..7b9e224544fc 100644 --- a/unoidl/source/sourceprovider-parser.y +++ b/unoidl/source/sourceprovider-parser.y @@ -1288,9 +1288,16 @@ structMember: default: break; } - if (nameHasSameIdentifierAs(data->currentName, id)) { + if (t.getName() == data->currentName) { // no need to worry about typedefs error( @2, yyscanner, + ("struct/exception type " + data->currentName + " direct member " + + id + " has same type as the type itself")); + YYERROR; + } + if (nameHasSameIdentifierAs(data->currentName, id)) { + error( + @3, yyscanner, ("struct/exception type " + data->currentName + " direct member " + id + " has same unqualified identifer as the type itself")); YYERROR; -- cgit