Fix segfault in macOS with 1989/paul
The problem was that the int * needed to be a long *. It became apparent to me when evaluating it with lldb as I noticed a pointer was long, not an int. This does not cause a problem with linux. I have no 32-bit system to test but I don't believe this will be an actual problem.
This commit is contained in:
1 parent
465d4239ed
commit
6b0cec23d6
4 files changed
+5
-10
No files matched your search
@@ -130,7 +130,6 @@ all: data ${TARGET}
|
||||
supernova deep_magic magic charon pluto
|
||||
|
||||
${PROG}: ${PROG}.c
|
||||
@echo "NOTE: this entry will likely dump core with arm64 chips."
|
||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||
|
||||
# alternative executable
|
||||
|
||||
+4
-3
@@ -11,14 +11,15 @@
|
||||
|
||||
make all
|
||||
|
||||
NOTE: this entry will likely dump core with arm64 chips. We could get it to work
|
||||
with modern systems with x86_64 but systems but at least with macOS arm64
|
||||
this program dumps core. We could not test Intel Macs.
|
||||
|
||||
## Try:
|
||||
|
||||
./paul
|
||||
|
||||
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed a segfault under
|
||||
macOS. The problem was that the int (from `#define f`) should be a long. This
|
||||
became apparent when he was using lldb and saw that the type of a pointer was
|
||||
long. Thank you Cody for your assistance!
|
||||
|
||||
## Judges' comments:
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#define f int
|
||||
#define f long
|
||||
#define v (void)printf(
|
||||
#define x ),exit(1);
|
||||
#define y ){if(n)c=z(n,u),u=n,n=c;o[i]=n?'0'+(1&*n):'0';}
|
||||
|
||||
@@ -361,11 +361,6 @@ better spent on something else here or in that elusive thing called 'real life'.
|
||||
|
||||
# 1989
|
||||
|
||||
## [1989/paul](1989/paul/paul.c) ([README.md](1989/paul/README.md))
|
||||
## STATUS: known bug - please help us fix
|
||||
|
||||
This entry works under linux but segfaults under macOS. We'll be working on this
|
||||
but if you have a fix we'll be happy to look at it.
|
||||
|
||||
## [1989/westley](1989/westley/westley.c) ([README.md](1989/westley/README.md))
|
||||
## STATUS: main() function args not allowed - please help us fix
|
||||
|
||||
Reference in new issue
Block a user