Crash affecting intermodule optimizations, some optimization levels (at least -O 6, although -O 1 seems to be fine), grade subdirs, and ssebug grades. Tested with 2020-04-28 ROTD and hlc.gc.spf.ssdebug grade on OpenBSD 6.5.

形式
Erlang
投稿日時
2020-05-11 06:06
公開期間
無期限
  1. % Any copyright is dedicated to the Public Domain.
  2. % https://creativecommons.org/publicdomain/zero/1.0/
  3. %
  4. % Released by Transnat Games for testing purposes.
  5. %
  6. % Crashes with the following compiler flags:
  7. % mmc --make crash -O 6 --intermodule-optimization --use-grade-subdirs \
  8. % --grade=hlc.gc.spf.ssdebug
  9. %
  10. % Crashes as:
  11. % Making Mercury/hlc.gc.spf.ssdebug/x86_64-unknown-openbsd6.5/Mercury/cs/crash.c
  12. % Uncaught Mercury exception:
  13. % Software Error: list.m: predicate `list.det_drop'/3: Unexpected: index out of range
  14. % ** Error making `Mercury/hlc.gc.spf.ssdebug/x86_64-unknown-openbsd6.5/Mercury/cs/crash.c'.
  15. %
  16. % The crash requires an optimization level (I'm not sure which, 1 is fine but 6
  17. % is not), intermodule optimizations, grade subdirs, and an ssdebug grade.
  18. :- module crash.
  19. %==============================================================================%
  20. :- interface.
  21. %==============================================================================%
  22. :- use_module array.
  23. :- type glyph.
  24. %------------------------------------------------------------------------------%
  25. :- pred measure(array.array(glyph)::in, int::out, int::out) is det.
  26. %==============================================================================%
  27. :- implementation.
  28. %==============================================================================%
  29. % glyph must be a foreign type.
  30. :- pragma foreign_type("C", glyph, "void*").
  31. %------------------------------------------------------------------------------%
  32. :- pred measure(_, int, int, int, int).
  33. :- mode measure(in, in, out, in, out) is det.
  34. measure(_, W, W, H, H).
  35. %------------------------------------------------------------------------------%
  36. measure(Glyphs, W, H) :-
  37. % There has to be something that actually uses the first argument to this predicate, otherwise the crash doesn't happen.
  38. array.foldl2(measure, Glyphs, 0, W, 0, H).
ダウンロード 印刷用表示

このコピペの URL

JavaScript での埋め込み

iframe での埋め込み

元のテキスト