Bug 1479672 - Comment what is going on in the exceptions test so I don't waste time figuring it out again, r=me
authorSteve Fink <sfink@mozilla.com>
Fri, 20 Jul 2018 10:47:26 -0700
changeset 497301 47d9c24f99d74b69396b503ba00b36e15dd9ef3c
parent 497300 a38d3c565e75d226b168deb110b127640d29cb91
child 497302 3a02fd73f28641c2150ebe8d8e4529769e871b96
push id9996
push userarchaeopteryx@coole-files.de
push dateThu, 18 Oct 2018 18:37:15 +0000
treeherdermozilla-beta@8efe26839243 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1479672
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1479672 - Comment what is going on in the exceptions test so I don't waste time figuring it out again, r=me
js/src/devtools/rootAnalysis/t/exceptions/source.cpp
--- a/js/src/devtools/rootAnalysis/t/exceptions/source.cpp
+++ b/js/src/devtools/rootAnalysis/t/exceptions/source.cpp
@@ -7,36 +7,39 @@ extern void GC() ANNOTATE("GC Call");
 void GC()
 {
     // If the implementation is too trivial, the function body won't be emitted at all.
     asm("");
 }
 
 class RAII_GC {
   public:
-    RAII_GC() {}
+    RAII_GC() { }
     ~RAII_GC() { GC(); }
 };
 
 // ~AutoSomething calls GC because of the RAII_GC field. The constructor,
 // though, should *not* GC -- unless it throws an exception. Which is not
-// possible when compiled with -fno-exceptions.
+// possible when compiled with -fno-exceptions. This test will try it both
+// ways.
 class AutoSomething {
     RAII_GC gc;
   public:
     AutoSomething() : gc() {
         asm(""); // Ooh, scary, this might throw an exception
     }
     ~AutoSomething() {
         asm("");
     }
 };
 
 extern void usevar(Cell* cell);
 
 void f() {
     Cell* thing = nullptr; // Live range starts here
 
+    // When compiling with -fexceptions, there should be a hazard below. With
+    // -fno-exceptions, there should not be one. We will check both.
     {
         AutoSomething smth; // Constructor can GC only if exceptions are enabled
         usevar(thing); // Live range ends here
     } // In particular, 'thing' is dead at the destructor, so no hazard
 }