Procházet zdrojové kódy

- disabled jump tables for x86_64, because they cause various kinds of
crashes with dynamic libraries (mantis #13628 and related bugs)

git-svn-id: trunk@13073 -

Jonas Maebe před 16 roky
rodič
revize
dd55947b4b
4 změnil soubory, kde provedl 46 přidání a 1 odebrání
  1. 2 0
      .gitattributes
  2. 5 1
      compiler/x86/nx86set.pas
  3. 10 0
      tests/webtbs/tw13628a.pp
  4. 29 0
      tests/webtbs/tw13628b.pp

+ 2 - 0
.gitattributes

@@ -8840,6 +8840,8 @@ tests/webtbs/tw13583.pp svneol=native#text/plain
 tests/webtbs/tw13596.pp svneol=native#text/plain
 tests/webtbs/tw13596a.pp svneol=native#text/plain
 tests/webtbs/tw13622.pp svneol=native#text/plain
+tests/webtbs/tw13628a.pp svneol=native#text/plain
+tests/webtbs/tw13628b.pp svneol=native#text/plain
 tests/webtbs/tw1364.pp svneol=native#text/plain
 tests/webtbs/tw1365.pp svneol=native#text/plain
 tests/webtbs/tw1374.pp svneol=native#text/plain

+ 5 - 1
compiler/x86/nx86set.pas

@@ -73,7 +73,11 @@ implementation
 
     function tx86casenode.has_jumptable : boolean;
       begin
-        has_jumptable:=target_info.system<>system_x86_64_darwin;
+{$ifdef i386}
+        has_jumptable:=true;
+{$else}
+        has_jumptable:=false;
+{$endif}
       end;
 
 

+ 10 - 0
tests/webtbs/tw13628a.pp

@@ -0,0 +1,10 @@
+{ %norun }
+
+library tw13628a; 
+
+uses
+  SysUtils; 
+
+begin
+end.
+

+ 29 - 0
tests/webtbs/tw13628b.pp

@@ -0,0 +1,29 @@
+{ %needlibrary }
+
+program loadmodule; 
+
+uses
+  dynlibs;
+
+const
+  {$ifdef unix}
+  {$ifdef darwin}
+  libname = './libtw13628a.dylib';
+  {$else darwin}
+  libname = './libtw13628a.so';
+  {$endif darwin}
+  {$endif unix}
+
+  {$ifdef windows}
+  libname = 'tw13628a.dll';
+  {$endif windows}
+
+var
+  hdl: TLibHandle; 
+begin
+  hdl := loadlibrary(libname);
+  if (hdl=nilhandle) then
+    halt(1);
+  if not UnloadLibrary(hdl) then
+    halt(2);;
+end.