root icon indicating copy to clipboard operation
root copied to clipboard

[cling] meta cmd .x should not crash if no file is given

Open jiangyilism opened this issue 3 years ago • 3 comments

Changes or fixes:

On Ubuntu 22.04 , execute standalone cling binary. In cmd prompt execute .x meta command without giving a filename, cling crashes.

The proposed solution is to directly reject the .x command without giving clear diagnostics. This is not user friendly but this is currently how MetaParser.cpp handles all parsing/input error. At least it prevents crashing.

Checklist:

  • [X] tested changes locally
  • [ ] updated the docs (if necessary)

jiangyilism avatar Aug 28 '22 20:08 jiangyilism

Can one of the admins verify this patch?

phsft-bot avatar Aug 28 '22 20:08 phsft-bot

@phsft-bot build

jiangyilism avatar Aug 30 '22 11:08 jiangyilism

@Axel-Naumann , @eguiraud Could anyone help reviewing this patch?

jiangyilism avatar Sep 19 '22 13:09 jiangyilism

Sorry for the slow response. What's the behavior / output when running .x without filename once this PR is applied? If there is absolutely no diagnostic, could you maybe add one as part of this PR? (If not then I will merge this as is - it's still better than crashing!)

Axel-Naumann avatar Jun 07 '23 14:06 Axel-Naumann

Sorry for the slow response. What's the behavior / output when running .x without filename once this PR is applied? If there is absolutely no diagnostic, could you maybe add one as part of this PR? (If not then I will merge this as is - it's still better than crashing!)

After this patch, the outputs are as follows:

[cling]$ .x
input_line_3:2:2: error: expected expression
 .x
 ^

jiangyilism avatar Jun 07 '23 19:06 jiangyilism