Hi Rajath -
Thanks for looking into this bug.
I'm hoping somebody else will also weigh in but here are my thoughts:
I'm leaning towards agreeing with you about two var-args
arguments not being useful, but I might be missing something.
You can, for example, have
proc vari(x... , otherArg:int) { }
and call that with something like this:
vari(1,2,3, otherArg=4);
but I can't think of any way to do a corresponding thing with a
second var-arg.
Also, we might get a better error message in this case if you
just detect the situation after or during parsing (rather
than making the parser not accept it). That way, we might get
an error like
error: multiple var-args arguments
instead of
error: syntax error
-michael
On 3/3/16, 8:20 AM, "Rajath Shashidhara" <[email protected]>
wrote:
>Hello,
>
>I ran strace on the chapel compiler for the code snippet given in this
>issue :
>https://chapel.atlassian.net/browse/CHAPEL-178
>
>I noticed that Chapel compiler runs into a SIGSEGV for this input.
>Using gdb, I have identified that there is a problem in
>expandVarArgs() in chapel/compiler/resolution/functionResolution.cpp
>
>But, I think the problem lies in the grammar definition. I don't think
>it is meaningful to allow more than one variadic arguments in the
>function declaration. It will make it impossible to assign actual
>parameters to formal parameters in this situation.
>
>If we agree that this is a grammar definition error, I can dig into
>the bison grammar specification and correct it to allow only one
>variable argument definition (at the end of parameter list).
>
>I can also dig deeper into the source code (understand the
>expandVarArgs()) in case this is not a grammar defn error.
>
>I would like to know your opinion!
>
>Thank you,
>Rajath Shashidhara
>
>--------------------------------------------------------------------------
>----
>Site24x7 APM Insight: Get Deep Visibility into Application Performance
>APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>Monitor end-to-end web transactions and take corrective actions now
>Troubleshoot faster and improve end-user experience. Signup Now!
>http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>_______________________________________________
>Chapel-developers mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/chapel-developers
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers