Buggy code:
class Safari extends WebBrowser { WebView webView ; SWTWebViewDelegate delegate ; boolean changingLocation ; String lastHoveredLinkURL ; String html ; int identifier ; int resourceCount ; String url = "" ; Point location ; Point size ; boolean statusBar = true ; boolean toolBar = true ; boolean ignoreDispose ; int lastMouseMoveX ; int lastMouseMoveY ; static boolean Initialized ; static Callback Callback3 ; static Callback Callback4 ; static Callback Callback5 ; static Callback Callback6 ; static Callback Callback7 ; static final int MIN_SIZE = 16 ; static final int MAX_PROGRESS = 100 ; static final String WebElementLinkURLKey = "WebElementLinkURL" ; static final String AGENT_STRING = "Safari//unknown" ; static final String URI_FROMMEMORY = "file://////" ; static final String PROTOCOL_FILE = "file:////" ; static final String PROTOCOL_HTTP = "http:////" ; static final String ABOUT_BLANK = "about:blank" ; static final String ADD_WIDGET_KEY = "org.eclipse.swt.internal.addWidget" ; static final String SAFARI_EVENTS_FIX_KEY = "org.eclipse.swt.internal.safariEventsFix" ; static final String SWT_OBJECT = "SWT_OBJECT" ; static final String DOMEVENT_KEYUP = "keyup" ; static final String DOMEVENT_KEYDOWN = "keydown" ; static final String DOMEVENT_MOUSEDOWN = "mousedown" ; static final String DOMEVENT_MOUSEUP = "mouseup" ; static final String DOMEVENT_MOUSEMOVE = "mousemove" ; static final String DOMEVENT_MOUSEWHEEL = "mousewheel" ; public void create ( Composite parent , int style ) { String className = "SWTWebViewDelegate" ; if ( ( OS . objc_lookUpClass ( className ) ) == 0 ) { Class safariClass = this . getClass ( ) ; Safari . Callback3 = new Callback ( safariClass , "browserProc" , 3 ) ; int proc3 = Safari . Callback3 . getAddress ( ) ; if ( proc3 == 0 ) SWT . error ( ERROR_NO_MORE_CALLBACKS ) ; Safari . Callback4 = new Callback ( safariClass , "browserProc" , 4 ) ; int proc4 = Safari . Callback4 . getAddress ( ) ; if ( proc4 == 0 ) SWT . error ( ERROR_NO_MORE_CALLBACKS ) ; Safari . Callback5 = new Callback ( safariClass , "browserProc" , 5 ) ; int proc5 = Safari . Callback5 . getAddress ( ) ; if ( proc5 == 0 ) SWT . error ( ERROR_NO_MORE_CALLBACKS ) ; Safari . Callback6 = new Callback ( safariClass , "browserProc" , 6 ) ; int proc6 = Safari . Callback6 . getAddress ( ) ; if ( proc6 == 0 ) SWT . error ( ERROR_NO_MORE_CALLBACKS ) ; Safari . Callback7 = new Callback ( safariClass , "browserProc" , 7 ) ; int proc7 = Safari . Callback7 . getAddress ( ) ; if ( proc7 == 0 ) SWT . error ( ERROR_NO_MORE_CALLBACKS ) ; int setFrameProc = OS . webView_setFrame_CALLBACK ( proc4 ) ; if ( setFrameProc == 0 ) SWT . error ( ERROR_NO_MORE_CALLBACKS ) ; String types = "*" ; int size = C . PTR_SIZEOF ; <START_BUG> int align = ( ( int ) ( ( Math . log10 ( PTR_SIZEOF ) ) // ( Math . log10 ( 2 ) ) ) ) ; <END_BUG> int cls = OS . objc_allocateClassPair ( class_NSObject , className , 0 ) ; OS . class_addIvar ( cls , Safari . SWT_OBJECT , size , ( ( byte ) ( align ) ) , types ) ; OS . class_addMethod ( cls , sel_webView_didChangeLocationWithinPageForFrame_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webView_didFailProvisionalLoadWithError_forFrame_ , proc5 , "@:@@@" ) ; OS . class_addMethod ( cls , sel_webView_didFinishLoadForFrame_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webView_didReceiveTitle_forFrame_ , proc5 , "@:@@@" ) ; OS . class_addMethod ( cls , sel_webView_didStartProvisionalLoadForFrame_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webView_didCommitLoadForFrame_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webView_resource_didFinishLoadingFromDataSource_ , proc5 , "@:@@@" ) ; OS . class_addMethod ( cls , sel_webView_resource_didFailLoadingWithError_fromDataSource_ , proc6 , "@:@@@@" ) ; OS . class_addMethod ( cls , sel_webView_identifierForInitialRequest_fromDataSource_ , proc5 , "@:@@@" ) ; OS . class_addMethod ( cls , sel_webView_resource_willSendRequest_redirectResponse_fromDataSource_ , proc7 , "@:@@@@@" ) ; OS . class_addMethod ( cls , sel_handleNotification_ , proc3 , "@:@" ) ; OS . class_addMethod ( cls , sel_webView_createWebViewWithRequest_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webViewShow_ , proc3 , "@:@" ) ; OS . class_addMethod ( cls , sel_webViewClose_ , proc3 , "@:@" ) ; OS . class_addMethod ( cls , sel_webView_contextMenuItemsForElement_defaultMenuItems_ , proc5 , "@:@@@" ) ; OS . class_addMethod ( cls , sel_webView_setStatusBarVisible_ , proc4 , "@:@B" ) ; OS . class_addMethod ( cls , sel_webView_setResizable_ , proc4 , "@:@B" ) ; OS . class_addMethod ( cls , sel_webView_setToolbarsVisible_ , proc4 , "@:@B" ) ; OS . class_addMethod ( cls , sel_webView_setStatusText_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webViewFocus_ , proc3 , "@:@" ) ; OS . class_addMethod ( cls , sel_webViewUnfocus_ , proc3 , "@:@" ) ; OS . class_addMethod ( cls , sel_webView_runJavaScriptAlertPanelWithMessage_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webView_runJavaScriptConfirmPanelWithMessage_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webView_runOpenPanelForFileButtonWithResultListener_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webView_mouseDidMoveOverElement_modifierFlags_ , proc5 , "@:@@I" ) ; OS . class_addMethod ( cls , sel_webView_printFrameView_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_webView_decidePolicyForMIMEType_request_frame_decisionListener_ , proc7 , "@:@@@@@" ) ; OS . class_addMethod ( cls , sel_webView_decidePolicyForNavigationAction_request_frame_decisionListener_ , proc7 , "@:@@@@@" ) ; OS . class_addMethod ( cls , sel_webView_decidePolicyForNewWindowAction_request_newFrameName_decisionListener_ , proc7 , "@:@@@@@" ) ; OS . class_addMethod ( cls , sel_webView_unableToImplementPolicyWithError_frame_ , proc5 , "@:@@@" ) ; OS . class_addMethod ( cls , sel_download_decideDestinationWithSuggestedFilename_ , proc4 , "@:@@" ) ; OS . class_addMethod ( cls , sel_handleEvent_ , proc3 , "@:@" ) ; OS . class_addMethod ( cls , sel_webView_setFrame_ , setFrameProc , "@:@{NSRect}" ) ; OS . objc_registerClassPair ( cls ) ; } browser . setData ( Safari . SAFARI_EVENTS_FIX_KEY ) ; WebView webView = ( ( WebView ) ( new WebView ( ) . alloc ( ) ) ) ;

Fix:
int align = ( ( C . PTR_SIZEOF ) == 4 ) ? 2 : 3 ;