[nem-en] On unreachable code inside macro generated code

Kamil Skalski kamil.skalski at gmail.com
Thu Aug 31 07:38:45 CEST 2006


Great!
But I guess there will still be a problem when iterating over array?
Because increment is probably places after the body.

On 8/31/06, Alexey Borzenkov <snaury at gmail.com> wrote:
> On 8/31/06, Kamil Skalski <kamil.skalski at gmail.com> wrote:
> > My guess is that compiler warns that  ()  expression is unreachable,
> > which should be somehow prevented, since () is an empty expression
> > (though it might load null on the stack if some conversions are
> > happening).
>
> Ooops, baka me. I thought it was about looping code. x_x
> You're absolutely right, it's about ()...
> But isn't getting rid of it extremely easy then?
> I'm commiting this patch:
>
> Index: ncc/generation/ILEmitter.n
> ===================================================================
> --- ncc/generation/ILEmitter.n  (revision 6595)
> +++ ncc/generation/ILEmitter.n  (working copy)
> @@ -440,7 +440,7 @@
>
>      static skipped (expr : TExpr) : void
>      {
> -      unless (expr is TExpr.Goto) {
> +      unless (expr is TExpr.Goto || expr is TExpr.Literal (Literal.Void)) {
>          Message.Warning (expr.loc,
>                           "this expression has been skipped in code "
>                           "generation because of unreachable code");
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>


-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list