RefactoringTools / wrangler

Wrangler -- An Erlang Refactorer
https://refactoringtools.github.io/wrangler/
Other
164 stars 45 forks source link

wrangler_slice_new:backward_intra_fun_slice/7 crash #71

Open leoliu opened 8 years ago

leoliu commented 8 years ago

Steps to reproduce the crash:

  1. Start emacs + wrangler
  2. Open file .../wrangler/src/wrangler_slice_new.erl
  3. Select S >= StartPos andalso E =< EndPos on line 83
  4. Press C-c C-w x
leoliu commented 8 years ago

I wonder if someone can help crush this bug. Basically wrangler_syntax:type/1 is receiving a list [#tree{}] and throws a badarg on it.

{badrpc,
 {'EXIT',
  {{badarg,
    [{tree, clause,
      {attr, {0, 0},
       [{bound,
         [{'EndPos', {82, 39}}, {'StartPos', {82, 29}}]},
        {free,
         [{'E', {80, 17}}, {'N', {81, 25}}, {'S', {80, 14}}]}],
       none},
      ......}]},
   [{wrangler_syntax, type, 1,
     [{file, '"src/wrangler_syntax.erl"'}, {line, 505}]},
    {wrangler_syntax, is_leaf, 1,
     [{file, '"src/wrangler_syntax.erl"'}, {line, 546}]},
    {wrangler_syntax, subtrees, 1,
     [{file, '"src/wrangler_syntax.erl"'}, {line, 6285}]},
    {api_ast_traverse, fold, 3,
     [{file, '"src/api_ast_traverse.erl"'}, {line, 249}]},
    {api_ast_traverse, fold_2, 3,
     [{file, '"src/api_ast_traverse.erl"'}, {line, 258}]},
    {api_ast_traverse, fold_1, 3,
     [{file, '"src/api_ast_traverse.erl"'}, {line, 255}]},
    {api_ast_traverse, fold, 3,
     [{file, '"src/api_ast_traverse.erl"'}, {line, 251}]},
    {wrangler_misc, bound_vars, 1,
     [{file, '"src/wrangler_misc.erl"'}, {line, 1044}]}]}}}