Index: src/wp-includes/comment.php
===================================================================
--- src/wp-includes/comment.php	(revision 35847)
+++ src/wp-includes/comment.php	(working copy)
@@ -1904,7 +1904,7 @@
 	}
 
 	// Make sure that the comment post ID is valid (if specified).
-	if ( isset( $commentarr['comment_post_ID'] ) && ! get_post( $commentarr['comment_post_ID'] ) ) {
+	if ( ! empty( $commentarr['comment_post_ID'] ) && ! get_post( $commentarr['comment_post_ID'] ) ) {
 		return 0;
 	}
 
Index: tests/phpunit/tests/comment.php
===================================================================
--- tests/phpunit/tests/comment.php	(revision 35847)
+++ tests/phpunit/tests/comment.php	(working copy)
@@ -70,6 +70,22 @@
 		$this->assertEquals( 1, $comment->user_id );
 	}
 
+	/**
+	 * @ticket 34954
+	 */
+	function test_wp_update_comment_with_no_post_id() {
+		$comment_id = self::factory()->comment->create( array( 'comment_post_ID' => 0 ) );
+
+		$updated_comment_text = 'I should be able to update a comment with a Post ID of zero';
+
+		$update = wp_update_comment( array( 'comment_ID' => $comment_id, 'comment_content' => $updated_comment_text, 'comment_post_ID' => 0 ) );
+
+		$this->assertEquals( 1, $update );
+
+		$comment = get_comment( $comment_id );
+		$this->assertEquals( $updated_comment_text, $comment->comment_content );
+	}
+
 	public function test_get_approved_comments() {
 		$ca1 = self::factory()->comment->create( array(
 			'comment_post_ID' => self::$post_id, 'comment_approved' => '1'
