diff --git a/labs/lab02/index.html b/labs/lab02/index.html index 2c60c188..f418cb1a 100755 --- a/labs/lab02/index.html +++ b/labs/lab02/index.html @@ -275,7 +275,7 @@

Memory Leaks and Corruption

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 brew install llvm
 PROFILE_FILE=$(if [[ -n $ZSH_VERSION ]]; then echo ~/.zshrc; else echo ~/.bash_profile; fi)
-echo 'ASAN_OPTIONS=detect_leaks=1\nexport PATH="/usr/local/opt/llvm/bin:${PATH}"' >> $PROFILE_FILE
+echo 'export ASAN_OPTIONS=detect_leaks=1\nexport PATH="/usr/local/opt/llvm/bin:${PATH}"' >> $PROFILE_FILE
 source $PROFILE_FILE

Now you can compile your code with AddressSanitizer enabled:

clang++ List.cpp ListItr.cpp ListNode.cpp ListTest.cpp -fsanitize=address -fno-omit-frame-pointer -g
diff --git a/labs/lab02/index.md b/labs/lab02/index.md index cadaff17..92cc9804 100755 --- a/labs/lab02/index.md +++ b/labs/lab02/index.md @@ -368,7 +368,7 @@ If you are using Mac OS X (and ONLY if you are using Mac OS X), then you will ne /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install llvm PROFILE_FILE=$(if [[ -n $ZSH_VERSION ]]; then echo ~/.zshrc; else echo ~/.bash_profile; fi) -echo 'ASAN_OPTIONS=detect_leaks=1\nexport PATH="/usr/local/opt/llvm/bin:${PATH}"' >> $PROFILE_FILE +echo 'export ASAN_OPTIONS=detect_leaks=1\nexport PATH="/usr/local/opt/llvm/bin:${PATH}"' >> $PROFILE_FILE source $PROFILE_FILE ```