diff options
author | theraven <theraven@FreeBSD.org> | 2014-01-16 03:10:16 +0800 |
---|---|---|
committer | theraven <theraven@FreeBSD.org> | 2014-01-16 03:10:16 +0800 |
commit | 37b780738fdad10f60ab48c90afecb107aabff86 (patch) | |
tree | f247ecf7e4c0f3782048df7b99f4aa190990767e /lang | |
parent | 3f5e4635a24ff82554f8d49657e98929e5e4184e (diff) | |
download | freebsd-ports-gnome-37b780738fdad10f60ab48c90afecb107aabff86.tar.gz freebsd-ports-gnome-37b780738fdad10f60ab48c90afecb107aabff86.tar.zst freebsd-ports-gnome-37b780738fdad10f60ab48c90afecb107aabff86.zip |
Backport bug fix from r37605 upstream. This fixes crashing when
Objective-C++ programs use Objective-C types in static constructors.
Approved by: bapt (mentor)
Diffstat (limited to 'lang')
-rw-r--r-- | lang/libobjc2/Makefile | 1 | ||||
-rw-r--r-- | lang/libobjc2/files/patch-arc.m | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/lang/libobjc2/Makefile b/lang/libobjc2/Makefile index 3e686b637694..edc9fc170270 100644 --- a/lang/libobjc2/Makefile +++ b/lang/libobjc2/Makefile @@ -3,6 +3,7 @@ PORTNAME= libobjc2 PORTVERSION= 1.7 +PORTREVISION= 1 CATEGORIES= lang devel gnustep MASTER_SITES= http://download.gna.org/gnustep/ diff --git a/lang/libobjc2/files/patch-arc.m b/lang/libobjc2/files/patch-arc.m new file mode 100644 index 000000000000..1dc141a73067 --- /dev/null +++ b/lang/libobjc2/files/patch-arc.m @@ -0,0 +1,30 @@ +--- ./arc.m.orig 2013-03-12 08:51:59.000000000 +0000 ++++ ./arc.m 2014-01-13 15:04:54.000000000 +0000 +@@ -219,15 +219,18 @@ + } + else + { +- [AutoreleasePool class]; +- useARCAutoreleasePool = class_respondsToSelector(AutoreleasePool, +- SELECTOR(_ARCCompatibleAutoreleasePool)); +- NewAutoreleasePool = class_getMethodImplementation(object_getClass(AutoreleasePool), +- SELECTOR(new)); +- DeleteAutoreleasePool = class_getMethodImplementation(AutoreleasePool, +- SELECTOR(release)); +- AutoreleaseAdd = class_getMethodImplementation(object_getClass(AutoreleasePool), +- SELECTOR(addObject:)); ++ useARCAutoreleasePool = (0 != class_getInstanceMethod(AutoreleasePool, ++ SELECTOR(_ARCCompatibleAutoreleasePool))); ++ if (!useARCAutoreleasePool) ++ { ++ [AutoreleasePool class]; ++ NewAutoreleasePool = class_getMethodImplementation(object_getClass(AutoreleasePool), ++ SELECTOR(new)); ++ DeleteAutoreleasePool = class_getMethodImplementation(AutoreleasePool, ++ SELECTOR(release)); ++ AutoreleaseAdd = class_getMethodImplementation(object_getClass(AutoreleasePool), ++ SELECTOR(addObject:)); ++ } + } + } + } |