[dlang.org] [D-Programming-Language/dlang.org] e9d464: Fix crash in index sample code

GitHub via dlang.org dlang.org at puremagic.com
Wed Jan 6 08:45:00 PST 2016


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/dlang.org
  Commit: e9d46478594cea7e018b905788204722e110dbe0
      https://github.com/D-Programming-Language/dlang.org/commit/e9d46478594cea7e018b905788204722e110dbe0
  Author: Lander Brandt <landaire at users.noreply.github.com>
  Date:   2015-12-08 (Tue, 08 Dec 2015)

  Changed paths:
    M index.dd

  Log Message:
  -----------
  Fix crash in index sample code

The example on dlang.org's index page which rounds floats currently crashes when ran. If you dump out `args` you can see that for some reason it's getting an empty string as `arg[1]`: `["./f347", ""]`

To "fix" this, I just removed support for reading from args.

```
std.conv.ConvException@/opt/compilers/dmd2/include/std/conv.d(2402): Floating point conversion error for input "".
----------------
??:? pure @safe bool std.exception.enforce!(bool).enforce(bool, lazy object.Throwable) [0x4b57ee]
??:? pure @safe real std.conv.parse!(real, immutable(char)[]).parse(ref immutable(char)[]) [0x4c8eee]
??:? pure @safe real std.conv.toImpl!(real, immutable(char)[]).toImpl(immutable(char)[]) [0x4ca1b9]
??:? pure @safe real std.conv.to!(real).to!(immutable(char)[]).to(immutable(char)[]) [0x4c8ea3]
??:? @safe real std.functional.__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ.compose!(immutable(char)[]).compose(immutable(char)[]) [0x4c8e6b]
??:? @safe immutable(char)[] std.functional.__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ.compose!(immutable(char)[]).compose(immutable(char)[]) [0x4c8e33]
??:? @property @safe immutable(char)[] std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult.front() [0x4cb006]
??:? ref @safe std.algorithm.iteration.joiner!(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]).joiner(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]).Result std.algorithm.iteration.joiner!(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]).joiner(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]).Result.__ctor(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]) [0x4cb477]
??:? @safe std.algorithm.iteration.joiner!(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]).joiner(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]).Result std.algorithm.iteration.joiner!(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]).joiner(std.algorithm.iteration.__T9MapResultS1633std10functional136__T7composeS253std4conv11__T2toTAyaZ2toS933std10functional67__T7composeS27_D3std4math5roundFNbNiNeeZeS223std4conv9__T2toTeZ2toZ7composeZ7composeTAAyaZ.MapResult, immutable(char)[]) [0x4cb2c9]
??:? _Dmain [0x4a7746]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x4dbe82]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x4dbdd8]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x4dbe3e]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x4dbdd8]
??:? _d_run_main [0x4dbd35]
??:? main [0x4d7669]
??:? __libc_start_main [0x40b6ba14]
```


  Commit: 605da98c44d6789dddce503b6651f99d48e9a50e
      https://github.com/D-Programming-Language/dlang.org/commit/605da98c44d6789dddce503b6651f99d48e9a50e
  Author: Andrei Alexandrescu <andrei at erdani.com>
  Date:   2016-01-06 (Wed, 06 Jan 2016)

  Changed paths:
    M index.dd

  Log Message:
  -----------
  Merge pull request #1165 from landaire/patch-1

Fix crash in index sample code


Compare: https://github.com/D-Programming-Language/dlang.org/compare/904d411c4ff0...605da98c44d6


More information about the dlang.org mailing list