NEW YORK — Big gains for technology and health care companies helped U.S. stocks set records again Wednesday. Rising crude and heating oil prices also sent energy companies higher.

Chipmakers including Nvidia and Advanced Micro Devices made big gains while Intel skidded following news that its processors have a security flaw that could slow down computers. Energy company Scana, which plunged after it canceled a $9 billion nuclear project and started raising rates to cover its costs, jumped after Dominion Energy agreed to buy it for $7.9 billion in stock.

Energy companies jumped for the second day in a row as oil prices, already at two-and-a-half-year highs, rose again. One reason is that after a pipeline bombing in Libya last month and ongoing anti-government protests in Iran, investors are concerned that oil supplies will get interrupted.

The Standard & Poor’s 500 index rose 17.25 points, or 0.6 percent, to 2,713.06. The Dow Jones industrial average added 98.67 points, or 0.4 percent, to 24,922.68. The Nasdaq composite climbed 58.63 points, or 0.8 percent, to 7,065.53. The Russell 2000 index of smaller-company stocks gained 2.56 points, or 0.2 percent, 1,552.58. All four finished at record highs.

Benchmark U.S. crude added $1.26, or 2.1 percent, to $61.63 a barrel in New York. Brent crude, used to price international oils, picked up $1.27, or 1.8 percent, to $67.84 a barrel in London.

Heating oil and natural gas prices have also climbed as severe cold gripped much of the U.S. Heating oil rose 3 cents to $2.09 a gallon, and it’s up 12 cents since Dec. 22. Natural gas slid 5 cents to $3.01 per 1,000 cubic feet, and it’s up 34 cents over that time.

Technology companies rose further. Chipmaker Nvidia gained $13.12, or 6.6 percent, to $212.47. Alphabet, Google’s parent company, climbed $18.31, or 1.7 percent, to $1,091.52. IBM added $4.24, or 2.7 percent, to $158.49.

Intel slumped after British technology site The Register reported a security problem that affects Intel’s processors, and said fixing the problem could slow down computers that use them.

Dominion Energy agreed to buy Scana in a deal that expands the Richmond, Virginia-based company’s business in the Carolinas. Dominion Energy is valuing the deal at about $7.9 billion plus $6.7 billion in debt. Scana stock soared $8.78, or 22.6 percent, to $47.65 and Dominion’s dropped $3.09, or 3.8 percent, to $77.19.