[Patch] fix IDL hang

Stefan (metze) Metzmacher metze at samba.org
Thu Aug 7 07:10:01 MDT 2014

Hi Noel,

>>> ./pidl/pidl --header --ndr-parser -- foo.idl
>>> will cause pidl to hang, the attached patch prevents the recursion that
>>> triggers that. Note: I compared the contents of
>>> bin/default/librpc/gen_ndr before and after the patch and the contents
>>> are identical
>> What's the reason for supporting this rather than errorring out?
> well it's a simplified version of a structure I want to represent via
> idl (and get the benefit of ndr generated marshall/unmarshall routines)
>>  What does midl do in this case?
> hmm I never used  midl before :/ trying it and it indeed does error out
> Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0500
> Copyright (c) Microsoft Corporation 1991-2006. All rights reserved.
> Processing .\foo.idl
> foo.idl
> .\foo.idl(5) : error MIDL2025 : syntax error : expecting a type
> specification near "baz"
> .\foo.idl(6) : error MIDL2026 : cannot recover from earlier syntax
> errors; aborting compilation
> but... not sure if that is a reason to be as restrictive (isn't it the
> case that things that compile with midl might not compile with pidl &
> vice-versa due to differences, extensions etc. )
> In anycase I'd be glad to know though if there is a some other way in
> idl to properly express below
>>> interface foobar
>>> {
>>> 	typedef [public] struct {
>>> 		baz anode;
>>> 	} foo;
>>> 	typedef [public,nodiscriminant,switch_type(uint32)] union {

Remove switch_type(uint32)

>>> 		[case(1)] foo afoo;
>>> 	} values;
>>> 	typedef [public] struct {
>>> 		[switch_is(ultype)] values avalue;

ultype need to be defined somewhere.

What are you trying to solve?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 246 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140807/34864a2a/attachment.pgp>

More information about the samba-technical mailing list